Author Topic: Breakpoint Being Ignored <with full debugger log>  (Read 20285 times)

dcbdbis

  • Guest
Breakpoint Being Ignored <with full debugger log>
« on: December 13, 2013, 02:01:44 am »
ArchLinux x86_64, 32Gb RAM
C::B 12.11
wxWidgets 2.8.12

In my project build options options, -g is checked, -s is unchecked.

I have also checked the setting under the "Settings->Compiler" to make sure -s is not checked and -g is.

No optimizations at all are checked in any location. I have also removed the "-" from the project directory name, and restarted C::B, rebuild all, with no changes in behaviour.

I am sure it's something entirely stupid....but I have only recently moved to C::B from an Embarcadero product so I am not that familiar with it (yet).

The program operates fine. But as I add logic under the hood...I am going to need the debugger working......

With respect, I've read and followed the wiki's that others with similar problems and were pointed to. My config and settings appear to be correct.


Help will be greatly appreciated.


Sincerely and respectfully,

Dave
//--------------------------------

Here is the full output of the debugger:

Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/
Adding source dir: /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/
Adding file: /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/bin/Debug/BicycleGearingCalculator
Changing directory to: /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/.
Set variable: LD_LIBRARY_PATH=.:

[debug]Command-line: /usr/bin/gdb -nx -fullname  -quiet  -args /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/bin/Debug/BicycleGearingCalculator
[debug]Working dir : /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator

Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/bin/Debug/BicycleGearingCalculator
done

[debug]Reading symbols from /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/bin/Debug/BicycleGearingCalculator...
[debug]done.
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.6.1
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-unknown-linux-gnu".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.6.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/
[debug]Source directories searched: /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "/home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/BicycleGearingCalculatorMain.cpp:340"
[debug]Breakpoint 2 at 0x41404f: file /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/BicycleGearingCalculatorMain.cpp, line 340.
[debug]>>>>>>cb_gdb:
[debug]> break "/home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/BicycleGearingCalculatorMain.cpp:338"
[debug]Note: breakpoint 2 also set at pc 0x41404f.
[debug]Breakpoint 3 at 0x41404f: file /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/BicycleGearingCalculatorMain.cpp, line 338.
[debug]>>>>>>cb_gdb:
[debug]> break "/home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/BicycleGearingCalculatorMain.cpp:341"
[debug]Breakpoint 4 at 0x414060: file /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/BicycleGearingCalculatorMain.cpp, line 341.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/dcbdbis/RamDisk/workspace/CodeBlocks-Projects/BicycleGearingCalculator/bin/Debug/BicycleGearingCalculator
[debug](BicycleGearingCalculator:2494): Gtk-WARNING **: Error parsing gtk-icon-sizes string:
[debug] 'panel-menu=24,24
[debug]panel=20,20
[debug]gtk-button=18,18
[debug]gtk-large-toolbar=24,24'
[debug]During startup program exited normally.
[debug]>>>>>>cb_gdb:

During startup program exited normally.

[debug]> quit

Debugger finished with status 0
« Last Edit: December 13, 2013, 05:43:51 am by dcbdbis »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #1 on: December 13, 2013, 02:35:59 am »
Code
[debug]During startup program exited normally.
Blehhh...
Can you try something to verify you have the same problem as I have:
1. make a tool that start bash ( name: bash, executable: xterm, parameters: -e bash, working directory: ${TARGET_OUTPUT_DIR}, launch options: the last one)
2. when you get this problem Tools -> Bash
3. execute gdb path_to_your_exe
4. set a break point
5. run

After you've verified that manually started gdb prints the same error, restart C::B and try to debug from codeblocks.
If it still doesn't work, keep restarting, till it works.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #2 on: December 13, 2013, 02:36:38 am »
What glibc are you using?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #3 on: December 13, 2013, 04:26:27 am »
glibc = 2.18.

Thanks!


Dave...

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #4 on: December 13, 2013, 05:01:32 am »
Dear oBFusCATed,

I can manually debug the program and it breaks properly when I open a terminal, and run gdb from the CLI. Then I specify "gdb sourcefilename:linenum". It works peechee, so my system's setup appears to be OK.


Thanks for your help,


Dave

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #5 on: December 13, 2013, 05:10:08 am »
I have a fix, but no reason why......

I know I got a little draconian.....but I went into my home dir and nuked ".codeblocks".

I know I lost all my fonts and colors, but something had to be wrong on my end, or the forums would be full of similar issues, and they are not.

Fired up C::B.......And my breakpoints work perfectly!

I have no idea why...


But I do appreciate your help!


Sincerely,


Dave

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #6 on: December 13, 2013, 05:44:35 am »
Well,

I marked this solved too soon. The debugger works about 15% of the time. The other times, it ignores the breakpoints still

Sincerely,


Dave

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #7 on: December 13, 2013, 09:57:47 am »
I can manually debug the program and it breaks properly when I open a terminal, and run gdb from the CLI. Then I specify "gdb sourcefilename:linenum". It works peechee, so my system's setup appears to be OK.
If you re-read the steps I've depicted you'll see that I'm asking you to test if debugging works from a terminal started by Code::Blocks.
I have the same problem and I'm trying to find why it happens. It is very strange problem, because gdb works fine from a normal terminal 100% of the time,
but started from C::B it fails and the failures are pretty strange. If it works once it will always work in this instance of C::B, but if it fails it will always fail until a restart of C::B.
Also it fails when started from a terminal started by broken instance of C::B. :'(

The current workaround is to restart C::B until it works and then use it without restarting it.
Can you confirm that this workaround works for you, too?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #8 on: December 13, 2013, 06:12:41 pm »
Here is a screen cap of the C::B CLI.

It ignored the breakpoint.

Thanks again for your help.

Sincerely,

Dave


« Last Edit: December 13, 2013, 06:14:50 pm by dcbdbis »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #9 on: December 13, 2013, 08:32:17 pm »
Grrrrhhhhhh....

Jens: Have you tried to debug something on a recent Fedora? Does it work there?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #10 on: December 13, 2013, 08:43:24 pm »
I'm an old guy. C/C++ developer since AT&T System V 3.3. Have done stuff at the device driver level.

Is there any way I can be a part of the solution, instead of being part of the problem?


AKA: Where can I get the source code for the plugin so I can start reading through it?


Sincerely,


Dave

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #11 on: December 13, 2013, 08:55:27 pm »
By any chance, does the debug plugin set any type of lock file to prevent accidental re-entrant calls from the C::B GUI?

Example: A call to do a debug session when the last session hasn't finished yet?

If it does, please tell me the name and where this file is located and I'll do some experimentation on this end.....

Also: If I nuke the .codeblocks dir from from my home...the debugger works first time every time..... It seems the issue is limited to debugger runs after the initial one, after the .codeblocks dir has been setup by C::B.



Sincerely,


Dave
« Last Edit: December 13, 2013, 09:06:11 pm by dcbdbis »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #13 on: December 14, 2013, 02:02:10 am »
By any chance, does the debug plugin set any type of lock file to prevent accidental re-entrant calls from the C::B GUI?
No.

Also: If I nuke the .codeblocks dir from from my home...the debugger works first time every time..... It seems the issue is limited to debugger runs after the initial one, after the .codeblocks dir has been setup by C::B.
Are you sure this is not just chance?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dcbdbis

  • Guest
Re: Breakpoint Being Ignored <with full debugger log>
« Reply #14 on: December 14, 2013, 04:57:12 am »
I mean anything is a possibility when debugging an inconsistent bug. But the times I have done it (nuked the .codeblocks dir), the debugger always worked on first run, then subsequent starts of the program were a crap shoot.

I think you may have a hunch where to look in the code.....Can you please give me a heads-up on which of the source files you pointed me at, where the whole debugger gets called and integrated into C::B?

Thanks!


Sincerely,


Dave