Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: MortenMacFly on March 31, 2006, 12:32:15 am

Title: Debugger not updating breakpoint position?
Post by: MortenMacFly on March 31, 2006, 12:32:15 am
Dear all,
I found something which unfortunately doesn't work as expected:
Create a console application and paste the following code into:
Code
#include <vector>
int main()
{
  std::vector<int> vd2;
  vd2.push_back(4);
  vd2.push_back(5);
  vd2.push_back(6);

  return 0;
}
Now set a breakpoint to the line that contains vd2.push_back(6);. Now compile (with the "-g" switch!) and run the debugger. It'll break nicely at that point. So far so good. Now do not remove the breakpoint but modify the code to the following by adding the upper 4 lines using the lower four ones via copy&paste to:
Code
int main()
{
  std::vector<int> vd1;
  vd1.push_back(1);
  vd1.push_back(2);
  vd1.push_back(3);

  std::vector<int> vd2;
  vd2.push_back(4);
  vd2.push_back(5);
  vd2.push_back(6);

  return 0;
}
(don't forget to at least rename the upper vector). You'll see the breakpoint has moved and still points to the line with vd2.push_back(6); but a few rows downwards. Now compile again and run the debugger. You'll see it will not stop at the line with the breakpoint (the one having the "red dot" set) but at the line containing vd1.push_back(3);. It seems the breakpoint in the editor (the "red dot") is updated to the correct new line but not the debug position internally. Is it easily possible to fix this?
With best regards, Morten.
Title: Re: Debugger not updating breakpoint position?
Post by: mandrav on March 31, 2006, 10:59:14 am
Fixed, thanks.