Is there a way to print the corresponding source code (C++) as the program runs?

Peng Yu pengyu.ut@gmail.com
Wed Feb 3 05:55:00 GMT 2010


On Tue, Feb 2, 2010 at 8:20 PM, dan hitt <dan.hitt@gmail.com> wrote:
> Peng ---- you must be aware of gdb?  So you probably have to
> compile with the -g flag set.
>
> I'm not sure if you can set gdb to do the printing the
> way you suggest, but it is the first thing to consider,
> i think ???

I know gdb, But I don't want to enter the interactive mode. I want the
program runs until it finishes without needing my intervention.

In interactive language such as R, both the source code along with the
output can be printed to stdout. This improves the productivity,
because I don't have to explicitly print anything to see where the
program run. If C++ has this capability, the programmer productive in
C++ can be improved.



More information about the Gcc-help mailing list