On Apr 22, 3:19 pm, Eddy <
souf....@gmail.com> wrote:
> Hi,
> How can I debug a NS 3 program ?
Start with ./waf --run yourprog --command-template="gdb %s" to load
it in gdb.
Quick commands:
Type "run" to start execution. When it fails, type "bt" to get
backtrace on where you were going.
Restart, but this time before "run" set breakpoints, e.g. break
mysource.cc:1234 to stop execution at that point. Then you can either
type n or s to step line-by-line through the execution (s steps into
function calls, n does not). You can use 'print varname' to check
contents of variables and pretty much anything else (for class
variables, you might need to use 'print this->classvar').
For more on gdb, google for it.