Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Remote GDB does not load symbols of dynamically loaded shared libraries automaticaly
Remote GDB does not load symbols of dynamically loaded shared libraries automaticaly [message #1283745] Thu, 03 April 2014 19:37 Go to next message
Jasmin Jessich is currently offline Jasmin JessichFriend
Messages: 2
Registered: April 2014
Location: Vienna, Austria (Europe)
Junior Member
Hi!

This is my first post here, so I say "Hello, from Vienna, Austria (Europe)!".
I am new to Eclipse, but I could manage it to set up my project with a lot of help from Mr. Google Very Happy

I did install the Eclipse GDB Hardware Debugging plugin, to be able to connect to my remote Linux machine. On the remote machine I started gdbserver with the required arguments for the TCP port and the executable.

In Eclipse I added a Debug Configuration with the IP of my remote machine and the TCP port. I activated to load the symbols of my binary, activated the initial breakpoint on main and disabled to load the image. In my .gdbinit file I added the sysroot path and the path for the shared libraries (in the meantime I know, I could add this lines to the startup configuration).

When I start the remote debugging session, GDB breaks on main as expected. If I now type "info sharedlib" in the GDB console, I see that there are shared libraries loaded, but the symbols are not loaded automatically. And yes auto-solib-add is on.

Now I add a breakpoint after the dlopen call and press the resume button.
After GDB is stopping, "info sharedlib" still doesn't show, that the symbols are loaded. Now I enter "sharedlib" and GDB does load all the symbols of all shared libraries. There is again a call to dlopen in my program. GDB did stop at the breakpoint and "info sharedlib" shows all symbols of all shared libraries, except the just loaded one. With "sharedlib" GDB will load the symbols of the new library, too.

When I use an xterm window and execute GDB in that window, GDB will load the symbols of all pre-linked libraries and the one loaded by dlopen automatically. Moreover, I was able to set a breakpoint on a line of a source file, which is inside a shared library, which is loaded by dlopen.

My question is now, is this problem of Eclipse, Eclipse CDT or the GDB Hardware Debugging plugin already known and how can I solve this?
It is really annoying to need this breakpoint after dlopen and to enter sharedlib. Moreover it is not possible to set breakpoints on files of a not loaded shared library.

Jasmin
Re: Remote GDB does not load symbols of dynamically loaded shared libraries automaticaly [message #1288450 is a reply to message #1283745] Tue, 08 April 2014 15:18 Go to previous message
Jasmin Jessich is currently offline Jasmin JessichFriend
Messages: 2
Registered: April 2014
Location: Vienna, Austria (Europe)
Junior Member
After some more digging into this issue, I found the solution to my problem.
I added the lines from .gdbinit into the debug configuration. I used the Startup section / Initialization Commands. Then I deleted the .gdbinit file.
With the next start of the GDB debug session, the problem was gone.
GDB did load the symbols of the dynamically loaded library. I checked it with a breakpoint just after the dlopen call and then with the command "info sharedlibrary".
Even a breakpoint in a currently not loaded shared library is now working.

BR
Jasmin
Previous Topic:iostream inclusion
Next Topic:How to extend CDT to parse comments and to show new elements in project explorer.
Goto Forum:
  


Current Time: Fri Apr 19 05:50:09 GMT 2024

Powered by FUDForum. Page generated in 0.02441 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top