Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Breakpoints are not set in remote attach launcher configuration
Breakpoints are not set in remote attach launcher configuration [message #1728592] Tue, 05 April 2016 16:52 Go to next message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
I am debugging a remote board running a gdb server.
I can use Eclipse to do step by step or continue and break, but if I set a breakpoint by double clicking on the left side on my source code line, it does not work. The breakpoint is shown in the UI, but my code won't break when reaching the breakpoint.
It works fine if I enter in the Eclipse gdb console the command "break file:line_number".
If I also type in the same console "set debug remote 1" to see the gdb 'protocol' data exchanges, I can see that nothing is sent to my board when creating a breakpoint with Eclipse UI.
With gdb or ddd, it is working fine.

I am using C/C++ Attach to Application configuration with gdbserver connected on a TCP port.


Re: Breakpoints are not set in remote attach launcher configuration [message #1728608 is a reply to message #1728592] Tue, 05 April 2016 19:34 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Which version of GDB are you using? Which version of CDT or Eclipse?
Re: Breakpoints are not set in remote attach launcher configuration [message #1728633 is a reply to message #1728608] Wed, 06 April 2016 06:51 Go to previous messageGo to next message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
Hello Marc,

Thanks for your answer.

I am using gdb version 7.11.50. It is a compiled version from sources with:
./configure --target=i386-elf

I am using Eclipse Mars with CDT version 8.7.0

On Ubuntu 14.04.

Re: Breakpoints are not set in remote attach launcher configuration [message #1728722 is a reply to message #1728633] Wed, 06 April 2016 16:25 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
First, there is a serious bug using GDB 7.11 (or 7.10) with CDT 8.7. I highly recommend upgrading to CDT 8.8 (or downgrading to GDB 7.9). Bottom line is that CDT thinks it is GDB 7.1 instead of 7.11.

I'm not 100% sure that will fix your problem, but it is the first thing to try before digging deeper.

Marc
Re: Breakpoints are not set in remote attach launcher configuration [message #1728821 is a reply to message #1728722] Thu, 07 April 2016 16:03 Go to previous messageGo to next message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
I updated CDT to 8.8.1, but the problem is still here.
I had a look at the console "gdb traces" and I can see that creating any breakpoints with ui does not trigger any gdb commands in this console.

Any idea what I could try?
Re: Breakpoints are not set in remote attach launcher configuration [message #1728846 is a reply to message #1728821] Thu, 07 April 2016 19:57 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
> It works fine if I enter in the Eclipse gdb console the command "break file:line_number".

When you do this, the breakpoint should get created in Eclipse as well and you should see it in the breakpoints view.
It should have a blue dot and a little checkmark on the blue dot.
Double-click on that breakpoint in the breakpoints view; this will open the editor for the file.
In that same editor, double click in the margin to set another breakpoint. Does that work?

I'm wondering if the editor you are currently trying to set breakpoints in is looking at the file with the same path as what GDB knows.

Marc
Re: Breakpoints are not set in remote attach launcher configuration [message #1729137 is a reply to message #1728846] Mon, 11 April 2016 13:09 Go to previous messageGo to next message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
Here is the experiment I did:

As the C/C++ Application seems useless in C/C++ Attach to Application Debug configurations, I left it empty. This means that I had to enter in the gdb console the command: file /path/to/my/elf_file to get debug working (debugged line display in editor view)
Then I tried your suggestion:
the command break relative_path_from_project/to/source:line_number
sets a breakpoint in breakpoint view and double clicking on it displays the right file in editor.
Clicking on Resume button (F8) executes the code and it breaks on breakpoint.

Now setting a breakpoint with UI on editor view does display the corresponding breakpoint in breakpoint view, but F8 won't break on it. I also see no exchange data in gdb trace console, and typing info breakpoints in console reports No breakpoints or watchpoints.

And by the way, I restarted from a fresh install of Eclipse in case, but it did not change anything. The problem is still here.
Re: Breakpoints are not set in remote attach launcher configuration [message #1729297 is a reply to message #1729137] Tue, 12 April 2016 16:41 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
> the command break relative_path_from_project/to/source:line_number
> sets a breakpoint in breakpoint view and double clicking on it displays the right file in editor.

If you restart your debug session with that breakpoint already present in the breakpoint view, does
the breakpoint gets sent to GDB or it becomes broken?

You may also want to try using the manual remote launch instead of the C/C++ Attach to application.
Please look for "Manual Remote Launch" in this wiki for details:
https://wiki.eclipse.org/CDT/User/FAQ#How_do_I_debug_a_remote_application.3F

Marc
Re: Breakpoints are not set in remote attach launcher configuration [message #1729488 is a reply to message #1729297] Thu, 14 April 2016 15:34 Go to previous messageGo to next message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
After restart, the breakpoint is still displayed in the Breakpoints view with correct status (double clicking on it send me to the editor view) but is not send to gdbserver (I can't see any breakpoint command in gdb trace console) and is not working (a go won't break).

For Manual Remote Launch, I will give it a try and come back to you.
Re: Breakpoints are not set in remote attach launcher configuration [message #1729490 is a reply to message #1729488] Thu, 14 April 2016 15:48 Go to previous message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
I tried Manual Remote Launch and it is working Razz (not exactly as I was expecting but it is working).
What is specific to my case is that the software we are debugging contains a breakpoint at the beginning to allow users time to connect gdb.
With Attach to Application, once Eclipse debug is started, I can see that I am stopped at my breakpoint (but I have to load manually my elf file)
With Manual Remote Launch, once Eclipse debug is started, I am not stopped on my code breakpoint, and I will break only if I set a breakpoint before launching the debug (w/o the need to load manually my elf file)

This is ok for me, but the behavior differs from gdb and what I expected.

Anyway, thanks a lot for your support.
Previous Topic:Error displaying array in base class
Next Topic:Weird debug perspective behaviour (buggy GDB console/variables view)
Goto Forum:
  


Current Time: Thu Apr 25 23:32:02 GMT 2024

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

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

Back to the top