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
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
please help me?
i changed RTO value in Timer.H file but my simulator get crashed even after proper compilation from CMD prompt ..