User forums > Help
Strangeness with stepping in debugger using toolbar button
burtbick:
Hi,
I didn't find any mention of this problem, so maybe it is just something with my configuration. I'm using the 10.05 version of Codeblocks on Kubuntu 8.04, and the SVN version of 10.05 on Kubuntu 10.04. Also using the latest CodeBlocks with the bundled MinGW under Windows. Everything is working well, but I have some strangeness when stepping though code in the debugger using the toolbar button(s) for stepping. At least on the two Linux installations. I need to recheck the Windows installation to see if the same issue is there.
Most of the time I can only step one or two lines and then the button doesn't do anything even though it is being clicked on. If I move the mouse pointer off of the toolbar button and then click the next line button again it steps OK for a single line and then I have to move the mouse pointer off of the button and back on in order to be able to continue stepping.
If I use the key binding to step to the next line F7 in this case there is no problem, I can keep hitting F7 and the debugger always steps one line for each key press.
But if I try to click the corresponding debugger toolbar button multiple times without moving off of the button and back on I get the problem of not being able to step through the code.
Has anyone else seen this problem? If so did you find a solution for it? If not do you have any suggestions to try and isolate the cause. Since it is happening on two different versions of Kubuntu, and two slightly different builds of CodeBlocks I don't think that it is something specific to the version of the OS or CodeBlocks.
I checked the bug reports but didn't see anything like this reported, so I entered a bug report there as well.
Thanks,
Burt
killerbot:
I can confirm this. This happens to me too all the time.
oBFusCATed:
Can you two tell me if this problem happens with debugger's branch version?
Does it depend on the project, because I can't reproduce it with the debugger's branch version?
Pecan:
--- Quote from: oBFusCATed on November 27, 2010, 10:33:26 am ---Can you two tell me if this problem happens with debugger's branch version?
Does it depend on the project, because I can't reproduce it with the debugger's branch version?
--- End quote ---
Yes, it happens in the debuggers branch. It's been a problem in CB (for me) for a long long time.
For me, it happens when the the cursor accidently hits a variable hidden behind the toolbar and CB wants to popup a tooltip. The tooltip is displayed behind CB (or the toolbar) and cannot be dismissed until the mouse is clicked in some other area of the editor window.
This happens because CB does a SetToolBar(0); Thus, wxWidgets cannot properly report the client area size and location. wxWidgets sees the cursor over a variable, doesn't know it's located behind the toolbars and pops up a (now hidden) tooltip.
Some 10.05 code to adjust for this is:
--- Code: ---Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 6378)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -2672,6 +2672,32 @@
wxPoint pt;
pt.x = event.GetX();
pt.y = event.GetY();
+
+ //(pecan 2009/3/20) begin
+ // Don't eval if cursor is out in unused space
+ if (ed->GetControl()->PositionFromPointClose(pt.x,pt.y) == wxSCI_INVALID_POSITION)
+ return;
+
+ // verify cursor is in the client area
+ wxRect edRect = ed->GetScreenRect();
+ wxPoint cursScreenPosn = ed->ClientToScreen(pt);
+ wxRect scintillaRect = ed->GetRect();
+
+ //int fstLine = ed->GetControl()->GetFirstVisibleLine();
+ //int fstLinePos = ed->GetControl()->PositionFromLine(fstLine);
+ //wxPoint fstLinePt = ed->GetControl()->PointFromPosition(fstLinePos);
+
+ edRect.y += (scintillaRect.y>0) ? 10 : 0; //why?
+ for (int i=0; i<3 ;++i )
+ edRect.x += ed->GetControl()->GetMarginWidth(i);
+
+ if ( (cursScreenPosn.x <= edRect.x) or (cursScreenPosn.y <= edRect.y)
+ or (cursScreenPosn.x > (edRect.x + edRect.width))
+ or (cursScreenPosn.y > (edRect.y + edRect.height))
+ )
+ return;
+ //(pecan 2009/06/15) end
+
int pos = ed->GetControl()->PositionFromPoint(pt);
int start = ed->GetControl()->WordStartPosition(pos, true);
int end = ed->GetControl()->WordEndPosition(pos, true);
--- End code ---
Commented code lines appear in the fix because I've never been happy with this fix and have experimented over and over again.
It does seem to work for 10.05 however.
I haven't yet adjusted it for the debugger branch.
oBFusCATed:
I think that a better place for this check is inside cbEditor::OnEditorDwellStart or even in Scintilla.
Navigation
[0] Message Index
[#] Next page
Go to full version