Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't set breakpoints in gdb remote debug(Eclipse uses windows style path when setting break point on remote Linux target. This causes a gdb assert.)
Can't set breakpoints in gdb remote debug [message #1747527] Tue, 15 November 2016 16:25
Chris Freehill is currently offline Chris FreehillFriend
Messages: 1
Registered: November 2016
Junior Member
My Setup:
I am running c/c++ Eclipse Neon on a Windows 10 host. I have a remote Linux target machine. I have Samba set up so both machines have access to the same source files and executable file.

I have set up an ssh connection and am debugging the target using gdb running on the target. I am using the Direct Remote C++ Debugging Eclipse plugin described here:
https://marketplace.eclipse.org/content/direct-remote-c-debugging

When launch the debugger, I reach main(), and am queried for the location of main.cpp (the file containing main()). I navigate to the remote drive, down to the location of main.cpp, visible from windows (for example Z:\remoteLinux\main.cpp). Eclipse is updated and I see the source and the PC pointer at the right location. I can single instruction step.

The problem occurs when I try to set a breakpoint. If I try to set a breakpoint in main.cpp, looking at the gdb console, I get an assertion in gdb, and gdb is there after not functional. The assertion is the following:

cp-namespace.c:252: internal-error: cp_search_static_and_baseclasses: Assertion `name[prefix_len + 1] == ':'' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) Please answer y or n.


Looking at the gdb traces console, I believe I can see what the problem is (aside from gdb not handling an error case well):

095,022 33-break-insert -f Z:/remoteLinux/main.cpp:271
095,439 33-break-insert -f Z:/remoteLinux/main.cpp:271


The problem, as far as I can surmise, is that gdb running on Linux is using the Windows style path (with the Z:/...) when it tries to set a breakpoint, and this causes gdb to fail.

I have set up some Path Mappings that map the target Linux style path to the local Windows style path. I think this helps in one direction when gdb provides a Linux style source location and Eclipse wants to map it to the local Windows style path so it can be displayed. But in the other direction, when Eclipse wants to tell gdb to set a breakpoint, it uses the wrong path style (Windows style) instead of the correct Linux style path.

So, does this theory sound correct? Is there a setting or mapping I need to adjust to handle this situation? If not, can you think of a work-around?

Thanks,
Chris
Previous Topic:ImageMagick++ on EclipseCDT
Next Topic:Link to OpenCV library - wrong syntax ?
Goto Forum:
  


Current Time: Sat Jan 22 23:40:24 GMT 2022

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

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

Back to the top