Bug 490996 - Editing code while breakpoint is active causes breakpoints to move after breakpoint disabling
Summary: Editing code while breakpoint is active causes breakpoints to move after brea...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 9.0.0   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-04 06:48 EDT by Stefan Sprenger CLA
Modified: 2020-09-04 15:20 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Sprenger CLA 2016-04-04 06:48:36 EDT
While editing code around an active breakpoint, it's position updated correctly according to the code changes. But if you disable the breakpoint in the breakpoints-view the position jumps back to the old position, regardless of the code in this line.

This bug is referenced by:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=487998

Follow this steps to reproduce the error:

Without starting a debug session and not saving the file at any step.

1.) Use the code snippet bewow
2.) Create a breakpoint on the "if" line
3.) Delete one of the "i++" lines, the breakpoint will move according to the "if" line as expected
4.) Disable the breakpoint by unchecking it in the breakpoints view
5.) Breakpoint is moved back to the "old position".


volatile int i = 0;
int main(void)
{
    while (1) {
    	i++;
    	i++;
    	if(i > 10000) i = 0;
    }
  return 0;
}
Comment 1 Stefan Sprenger CLA 2016-04-04 06:59:34 EDT
It doesn't matter if a line is added/deleted, if the breakpoint line is changed both things lead to the same issue.