I don't know how reliably this can be repeated. Can anyone else?
Steps:
Debug C::B
Set breakpoint at parser.cpp:899
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.
Log from Debugger tab:
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.
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)").
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.
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
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").
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
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
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.
g++ -include "Precompiled.h" -g -Wshadow -Winit-self -Wredundant-decls -Wcast-align -std=c++0x -Wall -pipe -fPIC -fvisibility=hidden