Author Topic: Debugger sometimes doesn't delete breakpoints  (Read 46578 times)

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Debugger sometimes doesn't delete breakpoints
« on: January 02, 2006, 04:34:46 pm »
I don't know how reliably this can be repeated. Can anyone else?

Steps:
Debug C::B
Set breakpoint at parser.cpp:899

Code
if ((event.GetInt() == 0 && !m_Options.followLocalIncludes) ||

Run
When it breaks, click twice pretty quickly on line 904.

Actual result:
Sets the breakpoint, but does not clear it. GDB still has a breakpoint there, but it is no longer marked in the editor and can't be deleted from then on. :(

Expected result: Set a new breakpoint and clear it.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Debugger sometimes doesn't delete breakpoints
« Reply #1 on: January 02, 2006, 05:59:48 pm »
I don't know if it is related to your problem but try this:

Put a breakpoint in a file. Run GDB and check it stops at the breakpoint. Stop GDB and edit the file, adding a few lines or removing a few lines before the breakpoint. Now delete the breakpoint. Run GDB and you will often find there is still a breakpoint there although you can't see one in the editor.

As an aside, how about having a 'delete all breakpoints' function?

Les

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Debugger sometimes doesn't delete breakpoints
« Reply #2 on: January 02, 2006, 06:15:05 pm »
As an aside, how about having a 'delete all breakpoints' function?

Try "Debug->Breakpoints->Remove all" :)

As for the other problems mentioned, I 'm aware of some bugs with the breakpoints and I will work on them on the next few days.
Be patient!
This bug will be fixed soon...

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Debugger sometimes doesn't delete breakpoints
« Reply #3 on: January 03, 2006, 11:02:03 am »
Try "Debug->Breakpoints->Remove all" :)

Well, er, that would do the trick  :oops:
Time for new glasses...

Les

Offline theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #4 on: December 10, 2012, 08:53:02 am »
This behavior is in svn8647, gdb linux 64bit.

Reseting, removing breakpoint, "Debug->Breakpoints->Remove all", restarting CB, restarting system, moving, shifting and breaking line do not help. "Breakpoints" window does not contain this point.

How to fix this or clear all gdb data manually?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #5 on: December 10, 2012, 09:09:48 am »
How to fix this or clear all gdb data manually?
Debug -> Remove all breakpoints or execute delete breakpoints command in the command field in the debugger's log window.

Would you like to post the full log of the debugger, so we can see what is going wrong 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!]

Offline theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #6 on: December 10, 2012, 01:16:46 pm »
Log from Debugger tab:
Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /main/rain/dev/src/ClientLauncher/
Adding source dir: /main/rain/dev/src/ClientLauncher/
Adding file: /main/rain/dev/RAIN/Platforms/Linux64_Debug/ClientLauncher
Changing directory to: /main/rain/dev/RAIN/Platforms/Linux64_Debug/
Set variable: LD_LIBRARY_PATH=.:/main/rain/dev/RAIN/Platforms/Linux64_Debug/:
Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args /main/rain/dev/RAIN/Platforms/Linux64_Debug/ClientLauncher
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (Gentoo 7.5 p1) 7.5
Child process PID: 20001
At /main/rain/dev/src/include/RainCore/Containers/DynamicArray.hpp:139

Running stop at line 139, but there are no breakpoints. Stop is only if there is at least one other breakpoint. In the example above, I have points at lines 120, 121, 124, not 139.

"Debug -> Remove all breakpoints" does not help. Execute "clear" in the command field in the debugger's log window delete 4 breakpoints (i have only 3), and after restart the point appears again. Execute "delete breakpoints" does not help too.

In "Debug -> Debugging Windows -> Breakpoints", too, only three.
« Last Edit: December 10, 2012, 01:21:46 pm by theven »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #7 on: December 10, 2012, 01:35:35 pm »
Go to the settings of the debugger and provide the full log.
(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 theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #8 on: December 11, 2012, 01:18:58 am »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #9 on: December 11, 2012, 10:38:40 am »
I see no errors in this log. Can you try to reproduce the problem and then provide the log?
(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 theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #10 on: December 11, 2012, 01:25:40 pm »
There are no errors. The problem is always reproduced.

Add breakpoint:
64. [debug]Breakpoint 1 ("/main/rain/dev/src/include/RainCore/Containers/DynamicArray.hpp:93") pending.
Stop:
82. At /main/rain/dev/src/include/RainCore/Containers/DynamicArray.hpp:139

Gist in number of line: 139.


« Last Edit: December 11, 2012, 01:28:17 pm by theven »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugger sometimes doesn't delete breakpoints
« Reply #11 on: December 11, 2012, 01:46:36 pm »
Can you provide the code that leads to this problem ?
Or other (sample) code, that has the same issue ?

Offline theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #12 on: December 11, 2012, 05:29:46 pm »
The code does not matter. I can insert any code, and there will be a stop. The point is that once set the breakpoint and after removed, it appears again, and again. Maybe it's a gdb bug. We need to determine where the bug, as long as there are reproducible behavior.
A similar case was six months - a year ago. I can not remember what it was.
« Last Edit: December 11, 2012, 05:43:56 pm by theven »

Offline theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #13 on: December 11, 2012, 06:05:48 pm »
But phantom breakpoint follows the code. I cut and pasted destructor to another location of the same file (inside class), the point has moved along with the code (moved from 139 to line 120 with "if(mBuffer)").
Code
136.
137. ~DynamicArrayImplStack()
138. {
139. if(mBuffer) { // <---- There (line 139)
140. for(size_t pos = 0; pos < mSize; ++pos) mBuffer[pos].destroy();
141. Core::Free(mBuffer, mBuffSize*sizeof(T));
142. }
143. }
144.

Code
117.
118. ~DynamicArrayImplStack()
119. {
120. if(mBuffer) { // <---- There (line 120)!
121. for(size_t pos = 0; pos < mSize; ++pos) mBuffer[pos].destroy();
122. Core::Free(mBuffer, mBuffSize*sizeof(T));
123. }
124. }
125.

The next thing I did, remove the destructor from the class
Code
117.
118. ~DynamicArrayImplStack();
119.
120. IteratorType begin() { return IteratorType( mBuffer[0].getElementPtr() ); } // <---- There!!! (line 120 again)
121.

743.
744. template <typename T, typename BufferStrategy>
745. DynamicArrayImplStack<T, BufferStrategy>::~DynamicArrayImplStack()
746. {
747. if(mBuffer) {
748. for(size_t pos = 0; pos < mSize; ++pos) mBuffer[pos].destroy();
749. Core::Free(mBuffer, mBuffSize*sizeof(T));
750. }
751. }
752.
and the phantom breakpoint remained on line 120! (With method "begin").

« Last Edit: December 11, 2012, 06:08:30 pm by theven »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #14 on: December 11, 2012, 06:26:30 pm »
The code does not matter. I can insert any code, and there will be a stop. The point is that once set the breakpoint and after removed, it appears again, and again. Maybe it's a gdb bug. We need to determine where the bug, as long as there are reproducible behavior.
A similar case was six months - a year ago. I can not remember what it was.
Probably the code is inlined in many translation units and the breakpoint is inserted many times.
But I've not seen any commands to delete the breakpoint from your log.
Please do a session reproducing the exact bug you see. And when the breakpoint is hit for the second time execute the gdb command "info breakpoints".
(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 theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #15 on: December 11, 2012, 08:59:05 pm »
Probably the code is inlined in many translation units and the breakpoint is inserted many times.
But I've not seen any commands to delete the breakpoint from your log.
Please do a session reproducing the exact bug you see. And when the breakpoint is hit for the second time execute the gdb command "info breakpoints".
It is not inserting many times, because phantom breakpoint place do not depend on where the normal points.

I do not understand what "hit for the second time" means. A point is always, if there is at least one other point.

Debugger full log with "info breakpoints" after hit.
http://www.everfall.com/paste/id.php?gsb8d80b8zas

That is interesting:
Debugger stops at the point in line 143. But info is displayed point only in lines 102, 104, 106, where at the moment I have is my real points ...and, method begin for all three , but in lines 102, 104 and 106 i have code of Constructor
Code
98.
99. explicit DynamicArrayImplStack(ConstIteratorType first, ConstIteratorType last):
100. mSize( std::distance(first, last) )
101. {       // I have breakpoint there
102. if(mSize == 0) return;
103.     // there
104. newBufferAllocateForElements(mSize);
105. // and there
106. ElementCopier<T>::CopyElementsArrayNewPlace(*first, data(), mSize);
107. }
108.
As you can see this code has nothing to do with the begin(), 102 for sure. :)

For reasons of clarity, I left only 102, all in exactly the same.
http://www.everfall.com/paste/id.php?5zd4rteraejt
« Last Edit: December 13, 2012, 12:01:29 am by theven »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #16 on: December 11, 2012, 09:07:03 pm »
Try to disable function inlining and verify you're using -O0 or no optiomizations.
(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 theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #17 on: December 12, 2012, 07:04:35 am »
Try to disable function inlining and verify you're using -O0 or no optiomizations.
Of course I'm building exactly, without any optimizations, only raw code for debugginig.
 
Code
g++ -include "Precompiled.h"  -g -Wshadow -Winit-self -Wredundant-decls -Wcast-align -std=c++0x -Wall -pipe -fPIC -fvisibility=hidden

Offline theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #18 on: December 13, 2012, 12:20:37 am »
I'm sure this is not related with code and inlining, because phantom point continues to appear in the same place at the debug even after setting of the breakpoints in another place, rebuilding workspace and rebooting the system. Also, it probably is related to the CB, because the point is moving with the code while shifting code in the editor. Let's try: tell me where it is stored raw information about breakpoints, I will show you the file. After I remove it and then try to find a order of actions for reliable reproduction of the problem (for the problem occurs).
« Last Edit: December 13, 2012, 12:24:50 am by theven »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #19 on: December 13, 2012, 12:35:58 am »
Let's try: tell me where it is stored raw information about breakpoints, I will show you the file. After I remove it and then try to find a order of actions for reliable reproduction of the problem (for the problem occurs).
What about trying another thing?
Open a console window, then try to debug you program using command line gdb. I'm sure you'll get the same behaviour.
(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 theven

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Debugger sometimes doesn't delete breakpoints
« Reply #20 on: April 17, 2013, 10:19:27 pm »
With high probability... solved by setting "Debugger settings -> Add other open projects' paths in the debugger's search list".
Thanks.

Offline mingkoonkat

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Debugger sometimes doesn't delete breakpoints
« Reply #21 on: May 14, 2013, 06:31:13 pm »
I also experience this problem when working on an embedded system; breakpoints are not removed by code blocks debugger gui, but they can be removed by command line gdb. I typically reboot the embedded system whenever I get tired of hitting a particular breakpoint rather than attempting to type long file name paths in the debugger. I use code block 12.11 from Jan 10th.
« Last Edit: May 14, 2013, 06:44:44 pm by mingkoonkat »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes doesn't delete breakpoints
« Reply #22 on: May 14, 2013, 08:38:53 pm »
mingkoonkat:
1. Can you post a full log from such a session?
2. You can use info breakpoints and delete #number it is way more shorter.
(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 mingkoonkat

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Debugger sometimes doesn't delete breakpoints
« Reply #23 on: April 08, 2014, 05:20:24 pm »

I had a quick look around in the doc and  the location on disk of the code blocks debugger log wasn’t immediately apparent.

I do appear to have a box checked for "full debug log" in the debugger configuration.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Debugger sometimes doesn't delete breakpoints
« Reply #24 on: April 08, 2014, 06:08:11 pm »
I do appear to have a box checked for "full debug log" in the debugger configuration.

check: Settings->Debugger->Common->Full (Debug) Log

The log can be found in the "Debugger" Tab in the bottom "Logs&other" window

greetings