Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to attach a debugging session to a running program in eclipse CDT

I'm writing a netscape iplanet plugin (on solaris/C using eclipse) which is basically a shared object with specific entry points, and I'd like to be able to debug the shared object with eclipse's debugger (gdb). I remember doing something similar in AIX where you could make xldb attach to a running process. Is it possible to get eclipse to run gdb to attach to a running binary? And should I expect grief because I want to debug a dynamically loaded piece of code?

like image 201
stu Avatar asked Mar 17 '09 20:03

stu


People also ask

Can we go back while debugging in Eclipse?

Yes, Eclipse CDT has support of historical debugger feature. Open Debug Configuration -> Debugger -> Enable Reverse Debugging at startup . Than you can press shift+F5 or shift+F6 for step back like F5 or F6 for step forward.

When debugging in eclipse what is the command to step over?

#2) Step over of F6: This option is also available as the icon shown below. Using this you can skip the debugger and execute the code. In this case, the code will execute normally till you keep hitting F6 and in the end, you will get the exception as you do while normally executing.

Is running in debug mode slower?

One of the main reasons that the debug version is significantly slower is because of these extra diagnostics. as to why you want to run in Debug, it's because those extra diagnostics are doing lots of useful stuff that help you catch bugs in your program so that you have more chance of the release build working.

What is Eclipse drop to frame debugging?

6. Drop to frame. Eclipse enables users to choose any frame (level) in the call stack during the debugging process and set the JVM to start again from the selected level. In simple words, it allows you to re-run a part of your program.


2 Answers

Yes it is. You need to go to the Lauch Configuration Dialog and select "C++ Attach to ...". Depending on your Eclipse version there may be only one or more "C++ Attach to ..." variants available.

like image 115
lothar Avatar answered Oct 25 '22 14:10

lothar


I use Eclipse CDT for HP/UX remote environment. I'm not sure whether it will work for you:

  1. have your app running on unix

  2. go to Run / Debug Configurations / C/C++ Attach to Remote

  3. click Debug and a list of processess will be shown

  4. select the process you want to debug.

like image 32
Paulo Guedes Avatar answered Oct 25 '22 16:10

Paulo Guedes