The ns-3 Network Simulator Project
Using Watchpoints in gdb (GNU Debugger) list the instances when the value of a variable changes in dumbbell-animation.cc
Watchpoints are used to stop execution of a program whenever the value of an expression changes. Use watchpoint in a C++ program ‘dumbbell-animation.cc’ using gdb (GNU Debugger) and set the condition as a variable. The program dumbbell-animation.cc can be found in src/netanim/examples. Copy this program in scratch folder and follow the steps given below to start debugging a program using gdb in ns-3:
- Copy dumbbell-animation.cc from src/netanim/examples to scratch
- Configure and build ns-3.
- Execute command: ./waf shell
- Execute command: gdb build/scratch/dumbbell-animation
- Run the program up to line number 81 and set a watchpoint on variable i.
- Run the complete program observing the change of value of variable i.
- Use delete command and use continue to run the program till it finishes its execution.
Provide the snapshots at each step for evaluation of the completed task.
You can refer to the video for introduction to gdb. One more video on gdb is here.
Reference to gdb commands.
Task tags
Students who completed this task
Parth Pratim, Asanali, Victor Hu, sikfeng, Parth Pandya, winningit, Phyxkal, bartekche, FelenAmvrosiy