2

I had good times debugging Java applications on Eclipse, but recently that I'm working on a C/C++ on Ubuntu 12.04 using Eclipse CDT, it ignores the breakpoints when debugging! I've tried two versions of Eclipse CDT, CDT 8.4.0 for Eclipse Luna, but doesn't work either. Can somebody help with that?

NOTE: I know there are some other similar questions, but I was thinking it is better to ask this question which specifically addresses CDT 8.4.0 for Eclipse Luna.

enter image description here

Tina J
  • 4,983
  • 13
  • 59
  • 125

6 Answers6

1

The eclipse-cdt is shipped only with the required tools for building c/c++ applications. It does not ship with gdb. You need to install that separately

How do I use GDB in Eclipse for C/C++ Debugging?

From link above these are the steps to follow.

1. Go to Help > Install New Software.
2. Add the CDT repository http://download.eclipse.org/tools/cdt/releases/8.4 to the list of repositories.
3. Select the CDT Repository. Now you need to install the CDT plugin along with GDB support from the list of available plugins (Select the CDT Main Features as well as CDT GNU Toolchain Debug support).

I updated the CDT repository path to correspond to your release (Luna).

Community
  • 1
  • 1
Rikard Söderström
  • 1,000
  • 6
  • 14
  • Thanks; idk why it does not work! Still can not debug from breakpoints. It shows a warning when I click on the GDB option: `warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000` I updated the photo. – Tina J Jul 09 '14 at 18:29
  • 2
    That warning seems to be caused by dynamic object that has been compiled without debug [symbols](http://stackoverflow.com/questions/18548139/gdb-warning-loadable-section-not-found-in-added-symbol-file-system-supplied-dso), no real harm in that case. On the image you posted it looks like the program is halted in main. Have you tried hitting resume? If you don't want this behavior you can uncheck the **Stop on startup at** checkbox under the **Debugger tab**, read [this](http://stackoverflow.com/questions/5768057/stop-eclipse-cdt-from-debugging-from-main) for more details about that. – Rikard Söderström Jul 10 '14 at 07:52
  • Yeah; it always starts from `main` regardless of breakpoints. – Tina J Jul 10 '14 at 15:53
  • 1
    On the menu Run -> Debug Configurations, right click the C/C++ Applications item on the left, and the specific configuration. Go to the Debugger tab and uncheck the Stop on startup at checkbox!!! – Tina J Jul 10 '14 at 17:24
  • If I uncheck the Stop on startup checkbox, it will stop on the first breakpoint, but if you run to the next breakpoint, it will not stop. It sounds like I have to roll back to Kepler. – fredk Sep 27 '14 at 23:23
1

It also happens for me in ReadHat 64 Seems like if the CDT breakpoints are not suitable for the current debug session, in the breakpoint window, when enabling "Show breakpoints Supported by selected target" all my breakpoints disapears from the list.

In my case, my ELF have debug info and all the breakpoints that I place are in the main ELF. My debug settings worked fine with the former Eclipse version.

I rolled back to eclipse Juno, and my debug session with same elfs worked out of the box.

juansolsona
  • 186
  • 7
0

Experiencing the same problem here.. I am working around it by manually setting breakpoints after starting debug session. Console -> gdb, then type "break xxxx".

0

If you're using MinGW gdb, check that C:\MinGW\bin is in your path (set in System Properties). Made all the difference for me.

BillT
  • 1
0

I once had Skip All Breakpoints accidentally checked, and was wondering what was going on.

James Hirschorn
  • 7,032
  • 5
  • 45
  • 53
0

I have the same problem with my eclipse Photon, I figured it out by unchecking the "stop on startup at: main" in Debug Configuration-->Debugger.

enter image description here

I know this in Rikard Söderström's response to you.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
anonymous
  • 61
  • 7