Author Topic: Debugger sometimes doesn't delete breakpoints  (Read 46787 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!]