Clone
1
OpenAirDebug
Cedric Roux edited this page 2016-01-17 19:13:39 +01:00

Finally we found a way to debug the code when compiled as kernel object and running under RTAI.

In the last version of the code on branches/cooperation, the RTAI default trap handler has been replaced and now also outputs the instruction pointer (ip). When the code crashes use dmesg and note that pointer. Lets call it <crash_addr>.

Then you have to use the script provided in $OPENAIR_TARGETS/RTAI/gdb-debug.sh to get the addresses for gdb

./gdb-debug.sh openair_rf openair_rf_softmodem.ko

Then go to $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER and call gdb like this

gdb openair_rf_softmodem.ko /proc/kcore

copy-paste the output of the script into gdb

to find the function the program got trapped in type

disassemble <crash_addr>

on gdb version > 6.8 you can add the option /m to get mixed c-source code. on older versions type

info line *<crash_addr>

to get the line number.

Alternatively you can also do a objdump -S -D openair_rf_softmodem.ko and look for the line number.

-- User.FlorianKaltenberger - 12 Aug 2011