Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stepping over library calls with gdb/gdbserver

I have a general gdb/gdbserver question. I'm trying to debug an arm linux embedded application using gdb on the host and gdbserver on the remote target. I can step through lines of code at the beginning of main. However, gdb (or gdbserver) seems to get lost after calls to shared library functions. Even when I set a breakpoint after the call and use continue, it never hits the breakpoint. I know I don't have symbols in the shared libraries and really don't care to step into them. Shouldn't I be able to step over the library calls in gdb successfully even without the symbols being in the shared libraries or at least continue to the next breakpoint? Or does this indicate a different type of problem?

like image 371
Jim Avatar asked Dec 15 '11 15:12

Jim


1 Answers

Breakpoints by address, rather than by symbol, are sometimes more reliable.

Try this:

(gdb) x/i my_func
0x12345678 <my_func> ...
(gdb) break *0x12345678
like image 163
ugoren Avatar answered Sep 20 '22 16:09

ugoren