Author Topic: FYI: Jump back to local variable definition line when debugging C::B source  (Read 43424 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
This is a really annoying debug experience when I debug C::B, the caret always jump back to some place and then go to the end of function end again when you step through lines (GDB next command).

I have reported in this post annoying debugging experience

This is a GCC bug Bug 49951 – [4.5/4.6/4.7 Regression] Debug stepping behavior regarding g++ Class destructor has changed for the worse starting at gcc 4.5.0. It was fixed around 2011-12-20, but the bad news is that it happened in GCC 4.8.1/4.8.2 again. (4.8.0 is not tested)
GCC 4.7.3/4.6.4 does not have such regression, so for a good debug experience, I suggest using the latest stable release of GCC 4.6/4.7 when debugging C++ applications under C::B.






If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Since I can't post a new thread(forum database error), I reply to this old thread.

This annoying bug is fixed now!

See the link in the above post.

I hope some GCC suite will have this fix soon.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.