[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Debugging in NS



On Mon, 10 Sep 2001, Joe Kwong wrote:

> 	I am reading mac-tdma.cc at the moment. I have found that
> there are a lot of print statements being commented. I have tried
> to uncomment those print statement and recompile the whole NS.
> However, it doesn't print anything when I run the
> test-suite-wireless-tdma.tcl. I am just wondering what those print
> statement do.

self-evident, I'd have thought.

> Plus, if I want to print out something(e.g debugging 
> statement), should I just add the print statement in the c++ file and the 
> recompile the whole NS and run.

these days we have debug functionality for this kind of thing, so you
don't need to recompile; you should just need to set debug_ to 1
for the appropriate object you're interested in.

if (debug_) {
 /* printf blah etc. */

}

selectively commenting out/uncommenting printf's and recompiling is
stone-age. Having said that, these messages aren't strictly debugging
messages - a verbose_ flag, anyone?

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>