Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Debugger breakpoints issue (again)
MortenMacFly:
Dear all,
after reading this: http://forums.codeblocks.org/index.php?topic=3261.msg25801#msg25801 I started to work on that. There is an easier way to reproduce:
1.) write a file with more that 2 lines of code. ;-)
2.) place a breakpoint at two lines that follow each other (e.g. 5+6).
3.) open the debugger's breakpoint window
4.) place the cursor on the end of the second line with the breakpoint
5.) hit return
-> Expected: The breakpoint shouldn't change.
-> Result: The second breakpoint gets lost.
Reason: There is a difference if you hit return and you are at the end of a line with a breakpoint or at the beginning of that line. If you are at the end the breakpoint of this line shouldn't change at all. If you are at the beginning (inserting a new line on return) the second breakpoint should shift one line.
Unfortunately I don't know how to figure out if the enter has been pressed at the beginning, at the end or somewhere in between... But this should be taken care of.
Any hints? BTW: The code to inspect is: cbEditor::OnEditorModified.
With regards, Morten.
Szabadember:
I know, how to do this with WinApi but i don't know anything about wxWidgets
Sorry.
nix_BB:
wxWidgets is uses the WinAPI to do its thing, so perhaps by explaining how to do it in the WinAPI we could figure out how to do it in wxWidgets :wink:
taZDeVil:
I think i solved the problem (*WHOOOO* my first constructive contribution). For this i simply suppress the resetting of the breakpoints if the cursor position is at EOF. Here is the diff:
Index: cbeditor.cpp
===================================================================
--- cbeditor.cpp (revision 2537)
+++ cbeditor.cpp (working copy)
@@ -1900,7 +1900,7 @@
// at the same time we 'll be removing those breakpoints
wxArrayInt bps;
int line = startline;
- while (line >= 0)// && line >= startline)
+ while (line >= 0 && event.GetPosition() == m_pControl->GetLength())// && line >= startline) //don't reset breakpoint if cursor pos is at EOF
{
int oldline = line - linesAdded;
int newline = line;
mandrav:
--- Quote from: gschafra on June 08, 2006, 11:15:44 am ---I think i solved the problem (*WHOOOO* my first constructive contribution).
--- End quote ---
Hmm, I don't know if your fix fixes an as-of-yet-unknown bug (will check shortly), but it has nothing to do with the reported bug.
Anyway, I 've fixed all breakpoint syncing issues when adding/removing lines in the editor (hopefully!).
Navigation
[0] Message Index
[#] Next page
Go to full version