www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Debugging with the printf debugger

reply "Frank Benoit (keinfarbton)" <benoit tionex.removethispart.de> writes:
Debugging in D is a lot of fun :)

I am searching for an idea, how to insert and remove trace statements
quickly.

Is there a trick i can do something like this:

TRC;
TRC; void func(){
TRC;   callThis();
TRC;   foreach( ....)...
TRC; }
TRC;

Add a very short 'something' at the start of each line. This something
shall do nothing, if not within any function/method, but if in
executable code, it shall print the line number.

Certainly it should not change control flow.

TRC;
TRC; if( condition())
TRC;   doAction();
TRC;

Is something like this possible?
Feb 16 2007
parent Jascha Wetzel <"[firstname]" mainia.de> writes:
besides the fact that there might be a way to do this, it seems to me,
it's just a cumbersome substitute for simple stepping - a debugger's
job. mere stepping through D code isn't a problem with existing debuggers.


Frank Benoit (keinfarbton) wrote:
 Debugging in D is a lot of fun :)
 
 I am searching for an idea, how to insert and remove trace statements
 quickly.
 
 Is there a trick i can do something like this:
 
 TRC;
 TRC; void func(){
 TRC;   callThis();
 TRC;   foreach( ....)...
 TRC; }
 TRC;
 
 Add a very short 'something' at the start of each line. This something
 shall do nothing, if not within any function/method, but if in
 executable code, it shall print the line number.
 
 Certainly it should not change control flow.
 
 TRC;
 TRC; if( condition())
 TRC;   doAction();
 TRC;
 
 Is something like this possible?

Feb 18 2007