tags:

views:

31

answers:

1

Hi,

while debugging a C++ program with GDB, is it possible somehow to add comments to the original souce code whitout affecting to the debugging process?

I started to debug with GDB, but if I modify (just adding comments at the end of each C++ code line wiht //) the code, when I display the code in GDB I get weird display.

Thanks

+2  A: 

Adding inline comments on existing lines should not pose a problem.

Adding new comments will break the existing line order (since debug symbols are per line number), giving you a shifted line display while debugging.

Yuval A
I see now that the most simple solution is to make a copy of the source file and comment it. Then recompile the program later, when ones has added 10 or 100 comments.
Werner