Debugging QUALNET with GDB

Compiling QualNet with Debug Option
By default, the optimization option of the compiler is enabled in the Linux and Mac OS X Makefiles. When the optimization option is enabled, the compiler may optimize the program for better performance. However, for better source level debugging, the optimization option of the compiler should be disabled and the debug option should be enabled.
Perform following steps to recompile QualNet with the debug option enabled:
1. Go to QUALNET_HOME/main. Copy the makefile for your compiler to Makefile.
2.Edit Makefile as follows:
•Enable the DEBUG line by removing the ‘#’ character so it is displayed as:
DEBUG = -g
•Disable the OPT line by inserting a ‘#’ character at the beginning of the line so it is displayed as:
# OPT = -O3
3.Recompile QualNet by typing the following commands:
make clean
make

Running the Debugger
QualNet can be run from within debug tools such as gdb or dbx. Here, we use gdb as an example.
To run gdb, perform the following steps:
1. Open a command window. Go to the directory where the scenario to be debugged is located.
2.Load the QualNet executable into gdb by typing the following command (this assumes that QualNet is installed in /home/username/qualnet/5.0):
gdb /home/username/qualnet/5.0/bin/qualnet
3.From within the gdb environment, run your scenario in gdb by typing the following command (assuming the scenario configuration file is myscenario.config):
run myscenario.config
4.To exit gdb, type following command in gdb:
quit
Refer to gdb user manual for more information on how to debug a program in gdb.


Taken from https://www.scalable-networks.com/boards/viewtopic.php?f=47&t=4833&start=0


To get the value of the current variables use
print name_of_the_variable

To see where the function is called from:
backtrace

Comments

ivy said…
This comment has been removed by a blog administrator.
Rohini said…
Sir I need LEACH Protocol implementation in Qualnet at network layer
please help me?
Anonymous said…
how to execute own codings in qualnet 5.0 regarding retransmission Time out
i changed RTO value in Timer.H file but my simulator get crashed even after proper compilation from CMD prompt ..

Popular posts from this blog

Timeline on Latex

Exporting Skype Chat/Skype Contacts to csv file using the shell script and sqlite3 (usually already installed on mac)

trim() not supported by IE7 and IE8