Code::Blocks Forums

User forums => Help => Topic started by: lehe on February 28, 2009, 04:42:21 am

Title: Edit-and-Continue and Running-Backward in Debug
Post by: lehe on February 28, 2009, 04:42:21 am

Hi,
I got two questions about debugging

1. Does CB has something like "Edit and Continue" as in Visual C++? More specifically, in VC, "Edit and Continue is a time-saving feature that enables you to make changes to your source code while your program is in break mode. When you resume execution of the program by choosing an execution command like Continue or Step, Edit and Continue automatically applies the code changes with some limitations. This allows you to make changes to your code during a debugging session, instead of having to stop, recompile your entire program, and restart the debugging session."

2. Does CB provide the ability to run programs backward? My CB is using gdb. As gdb reference says, "If the target environment supports it, gdb can allow you to “rewind” the program by running it backward". Then how to make my target environment support it in CB?

Thanks in advance!
Title: Re: Edit-and-Continue and Running-Backward in Debug
Post by: ollydbg on February 28, 2009, 05:11:10 am

Hi,
I got two questions about debugging

1. Does CB has something like "Edit and Continue" as in Visual C++? More specifically, in VC, "Edit and Continue is a time-saving feature that enables you to make changes to your source code while your program is in break mode. When you resume execution of the program by choosing an execution command like Continue or Step, Edit and Continue automatically applies the code changes with some limitations. This allows you to make changes to your code during a debugging session, instead of having to stop, recompile your entire program, and restart the debugging session."

NO.
By the way, if the linker and gdb can do this, then c::b can.
Edit:
I don't think this feature is necessary.
Title: Re: Edit-and-Continue and Running-Backward in Debug
Post by: lehe on February 28, 2009, 05:25:06 am
It could be handy to me when it has taken so long to get to a point where I want to make a slight change to the code but don't want to wait another long time to get to the same place. If you have alternative strategy in such case, it would be nice!

How about running backwards? Does it require setting up some option during compilation?
Title: Re: Edit-and-Continue and Running-Backward in Debug
Post by: ollydbg on February 28, 2009, 05:35:51 am
It could be handy to me when it has taken so long to get to a point where I want to make a slight change to the code but don't want to wait another long time to get to the same place. If you have alternative strategy in such case, it would be nice!

How about running backwards? Does it require setting up some option during compilation?

So, You mean "move the EPC when debugging?".
There are some topics on this forum, just search.
Title: Re: Edit-and-Continue and Running-Backward in Debug
Post by: lehe on February 28, 2009, 05:47:49 am
By running backwards, I mean "When you are debugging a program, it is not unusual to realize that you have gone too far,
and some event of interest has already happened. If the target environment supports it,
gdb can allow you to “rewind” the program by running it backward."
What is  EPC?
Title: Re: Edit-and-Continue and Running-Backward in Debug
Post by: ollydbg on February 28, 2009, 06:01:48 am
What is  EPC?
http://en.wikipedia.org/wiki/Program_counter

I haven't used "rewind" before, so, I have no comment on that.
Title: Re: Edit-and-Continue and Running-Backward in Debug
Post by: Jenna on February 28, 2009, 11:23:07 am

Hi,
I got two questions about debugging

1. Does CB has something like "Edit and Continue" as in Visual C++? More specifically, in VC, "Edit and Continue is a time-saving feature that enables you to make changes to your source code while your program is in break mode. When you resume execution of the program by choosing an execution command like Continue or Step, Edit and Continue automatically applies the code changes with some limitations. This allows you to make changes to your code during a debugging session, instead of having to stop, recompile your entire program, and restart the debugging session."

2. Does CB provide the ability to run programs backward? My CB is using gdb. As gdb reference says, "If the target environment supports it, gdb can allow you to “rewind” the program by running it backward". Then how to make my target environment support it in CB?

Thanks in advance!

1. No, gcc does not (yet?) support incremental compiling.
There is (was?) a project to make gcc compile incremental, see here: http://gcc.gnu.org/wiki/IncrementalCompiler (http://gcc.gnu.org/wiki/IncrementalCompiler).

2. Also no, even if it can be an intersting feature, but I just tested it on a small wxWidgets-project from commandline, and it seems not to work reliable.