0

I'm debugging a C project in eclipse CodeSourcery IDE. The project runs in a linux-arm device so I cross-compile and debug it with gdbserver. My project consist of a main program and some shared libraries, which i compile with -g3 tags (tried -g also). Everything builds correctly: the linker finds all dependencies, i copy the compiled files into the remote machine and i run

$gdbserver :2159 Test &

and i can start debugging remotely after configuring IDE's Debugger. I debug correctly until i 'step into' a library function. I get an output message

[New Thread 1032]

No error gets prompted, except that i can't debug inside the function, but the function executes correctly and I can continue on my main program. Later on, inside another library i get a segmentation fault.

I am supposing gdbserver search for sources on my local machine as i can debug my main program. Why can't I debug my libraries's source code?

Thanks

Joster
  • 359
  • 1
  • 4
  • 19

1 Answers1

0

How to runtime debug shared libraries?

Looking at that question you can see that gdb can assign break points to functions inside of libraries just by using a function name.

(gdb) b func
Function "func" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (func) pending.
Community
  • 1
  • 1
Dellowar
  • 3,160
  • 1
  • 18
  • 37
  • Not exactly my problem. How can I do this when gdbserver doesn't find the library's source files? – Joster Jan 20 '17 at 14:03