Author Topic: Problems debugging when attaching to process with gdb  (Read 1440 times)

rowbearto

  • Senior Community Member
  • Posts: 2256
  • Hero Points: 132
Problems debugging when attaching to process with gdb
« on: September 13, 2018, 02:35:44 am »
Using linux x64, centos 7.2.1511 with SlickEdit version 23.0.0.5

Download attached tarball.

Build the executable outside of SlickEdit by running the "./bld" command. It yields executable "debug". It is using my system's gcc, version info:

$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

Not sure if you need this specific version of gcc to repro or not, try your system's gcc and continue on. I've seen similar issues on my "real" project using gcc:

$ i686-cp-linux-gnu-g++ --version
i686-cp-linux-gnu-g++.bin (crosstool-NG crosstool-ng-1.22.0-10-gfb7b8a9) 5.2.0

Outside of SE, in a konsole (or any shell) window, run "./debug" and start the program. It is prompting you to enter a string, leave it there asking for a string.

Now go to SE, open the workspace "debug.vpw".

Debug->Attach Debugger->Attach to running process (GDB)

Choose the "debug" process to attach to, and press OK.

Issue #1: The call stack is showing all "??" instead of the actual call stack. See attached screenshot - "se_call_stack_with_junk.png". When I do the equivalent attach with an eclipse neon IDE debugger, I get a meaningful stack trace, see attached eclipse_stack_trace.png.

Now double click on line 10 to set a breakpoint.

Continue the program (Debug->Continue)

Go to the window where "debug" is running, enter a string and press <ENTER>.

Issue#2: Breakpoint should hit. It does NOT hit. If I do the equivalent with the eclipse neon IDE debugger after attaching, the breakpoint DOES hit.

Thanks for taking a look!
« Last Edit: September 13, 2018, 02:40:11 am by rowbearto »

rowbearto

  • Senior Community Member
  • Posts: 2256
  • Hero Points: 132
Re: Problems debugging when attaching to process with gdb
« Reply #1 on: September 13, 2018, 02:54:48 am »
I think I see what the issue is. In addition to choosing the process to attach SE to, SE also wants the user to provide the path to the executable file "debug". And I had something else in the "File:" edit box from a previous debugging session.

Eclipse does not require the user to provide the executable. All I need to do is point eclipse to the process to debug, and it is able to find the executable and debugging information on its own.

It would be really really nice if I did not need to provide the executable in the "File:" edit box. It is error prone to ask for it there because I may have the executable from my last debugging session there. Also Eclipse does not need this info, so it would be nice if SE also didn't require it.