Debugging C ++ lib with eclipse

I am working on a project on Linux that includes 1) Static Lib in C ++ 2) GUI developed in C ++ / QT that uses static lib.

Now both lib and gui are built from the command line using makefiles.

I am trying to debug both, when I click one button, the call must go from GUI to lib.

Can this be done on Linux using eclipse? I can easily follow the same debugging procedure on Windows using Visual studio and attach the lib to the GUI, but I cannot find a good way to do it using eclipse.

I tried many IDE / debuggers like Anjuta Code Blocks. DDD, KDBG but none are working properly.

I'm not sure if I'm wrong or difficult to debug?

Can anyone suggest one correct way to debug?

0


source to share


3 answers


Ok I figured it out. I am currently using Kdevelop .. With Kdevelp we can create a QT project as well as a C ++ (lib) project. And it is possible to attach a process. So I can go through the lib code by adding a GUI.



+1


source


There should be no problem with debugging a static library, as the relevant parts will be embedded in the binary you are debugging. If you have problems, some things to check are that both the library and the binary are built with debug information (usually an option -g

for the compiler on Linux) and that your debugger has access to the source code of the library.



Can you be more specific about how debugging doesn't work? It looks like "logging in" to a library function is not working as you expect.

+1


source


I created a new project in eclipse and added the existing source folder. Then it automatically adds all the source files. The project has its own custom makefile. Now when I try to debug the project, it shows me the Debug window where I selected the Attach to Local C / C ++ application because I want to attach the lib to the GUI.

It asks me to enter the project name in the debug window.

On Windows with visual studio, it provides a list of processes that can be connected, but here I have to create a project?

I do not understand this.

0


source







All Articles