Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: 280Z28 on January 02, 2006, 04:34:46 pm

Title: Debugger sometimes doesn't delete breakpoints
Post by: 280Z28 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: lesnewell 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
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: mandrav 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: lesnewell 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
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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?
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed 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?
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed on December 10, 2012, 01:35:35 pm
Go to the settings of the debugger and provide the full log.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven on December 11, 2012, 01:18:58 am
Full debug log http://www.everfall.com/paste/id.php?xodh1ueknlj2
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed 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?
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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.


Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: Jenna 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 ?
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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").

Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed 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".
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed on December 11, 2012, 09:07:03 pm
Try to disable function inlining and verify you're using -O0 or no optiomizations.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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).
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: theven 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: mingkoonkat 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: oBFusCATed 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: mingkoonkat 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.
Title: Re: Debugger sometimes doesn't delete breakpoints
Post by: BlueHazzard 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