1

I am using Eclipse IDE for C/C++ Developers and want to debug my C-code but the debugger ignores all breakpoints. This also happens when I put a break point in the very first line of the program so there must be something that is not properly set up.

I saw that many other people have a similar/same issue which could be fixed by updating JDK to 1.6 for example. But I have 1.8.0_161 which so that can't be the issue I suppose.

What else can I try or should I look at?

  • Windows 7
  • java version "1.8.0_161"
  • Eclipse IDE for C/C++ Developers, Version: Oxygen.2 Release (4.7.2)

Edit: Compiling and running a program works fine (i.e. the output is as I expect).

Edit 2: Here is the output from the "Debugger Console" (only thing I changed is the "..." part in the path for confidential reasons):

GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later     <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
No source file named \\\\...\\MyPapers\\Electricity\\Implementation\\PowerLineRouting\\src\\PowerLineRouting.c.
No source file named \\\\...\\MyPapers\\Electricity\\Implementation\\PowerLineRouting\\src\\PowerLineRouting.c.

[New Thread 11104.0x2440]

The file "PowerLineRouting.c" exists at the location on that path on my computer however (when I use the Windows Explorer).

Thanks for any input!

BJPrim
  • 338
  • 5
  • 20
  • 1
    Is your code actually getting compiled? Note that eclipse does not come with a compiler so compiler and related tools must be installed separately. – user7860670 Apr 16 '18 at 17:15
  • Yes my code compiles properly and also produces the desired output when I run it. However, it shows two suspicious errors (see edit) – BJPrim Apr 16 '18 at 17:25
  • I guess the problem is that gdb is also not found in `PATH`. So try to add the directory that contains gdb to Window's `PATH` variable. – howlger Apr 16 '18 at 18:01
  • Well, your program did not compile. That reason, as clearly stated int the error messages is that the IDE could not find the compiler. – user3629249 Apr 17 '18 at 06:33
  • @user3629249 no, my program does compile and also executes as desired as I wrote in the post. – BJPrim Apr 17 '18 at 13:34
  • for the `gdb` debugger to do much of anything, the source code must be available and best to have compiled/linked with the `-ggdb` parameter – user3629249 Apr 17 '18 at 16:03
  • Also see: https://stackoverflow.com/questions/4388192/eclipse-doesnt-stop-at-breakpoints – davmac Apr 19 '18 at 14:06

1 Answers1

2

In the debug perspective toolbar there is a button which has an icon that looks like a breakpoint marker (blue circle) with a diagonal line through it:

"skip all breakpoints" button

The hover text is "skip all breakpoints". If you have turned this on accidentally, breakpoints are ineffective. I've been bitten by this before myself...

davmac
  • 20,150
  • 1
  • 40
  • 68
  • @BJPrim then I suggest opening the GDB console in eclipse and using GDB commands to verify whether Eclipse is actually setting the breakpoints and has them enabled etc. There may also be errors which could give a clue to what's gone wrong. – davmac Apr 20 '18 at 10:46
  • OK, I opened the "Debugger Console" (which is according to what I found the new (?) equivalent to the GDB console). I executed the debugger and added the output as edit 2 in the main post. – BJPrim Apr 20 '18 at 13:00