for your eyes only
Knowledge Hurts – a blog of thoughts, things and stuff.

Debugging ns2 with mannasim

Debugging ns2 is easy (or should be):

  1. go to ns-?.?? directory
  2. run ./configure –enable-debug
  3. make clean
  4. make

BUT here comes the big BUT:

for the –enable-debug option the compiler flag -WError is passed to gcc and will make it throw errors instead of warnings in many cases – for the (sometimes not too well written) Mannasim code, this is deadly: It won’t compile due to formalities.

If you get errors when compiling ns with Mannasim in order to debug: Edit the configure script and change the part where -WError is passed. It will compile like a charm (if you don’t run into compiler bugs).

You might want to pass arguments to the executable that you want to debug.

you can do this without problems:

gdb [gdbarguments] -args yourexecutable yourarguments

By calling a gdb-script, you can run the executable automatically and also quit gdb if everything went fine.

Create such a batch file by running

echo "run" > run.script

and execute it like this:

gdb [gdbarguments] -x run.script -args yourexecutable yourarguments

And all of a sudden you have the possibility to call gdb inside of scripts without having to type run all over again. Practical, huh?

Read on! Knowledge hurts.

Advertisements

No Responses to “Debugging ns2 with mannasim”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: