简体   繁体   中英

Debugging C++ lib with eclipse

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

Now both the lib and gui are build from command prompt using makefiles.

I am trying to debug both like when I hit one button, call should go from GUI to lib.

Is it possible to do like this in Linux with eclipse? I can easily follow same debugging procedure in Windows using Visual studio and attaching lib to GUI but I cannot find any good way to do here with eclipse.

I have tried many IDEs/debuggers like Anjuta Code Blocks. DDD,Kdbg but none is working properly.

I am not sure that if I am wrong or is it much complex to debug?

Can some one suggest one proper way to debug ?

There shouldn't be any problem with debugging a static library as the relevant portions of it will be built in to the binary that you are debugging. If you are having problems then some things to check are that both the library and the binary are built with debugging information (usually the option -g to the compiler on linux) and that your debugger has access to the source code to the library.

Can you be any more specific about how debugging isn't working? It sounds like 'stepping in' to a library function isn't working as you are expecting it to.

Well I figured it out.. I am currently using Kdevelop.. With Kdevelp we can create QT project as well as c++(lib) project. And there is option to attach process also. So I can step through lib code by attaching GUI .

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

It asks me to enter project name in Debug window.

In Windows with visual studio it gives list of processes that can be attached, but here am I supposed to create project ?

I dont understand this..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM