The ns-3 Network Simulator Project

Set breakpoints at three places in star.cc and list all of them using gdb (GNU Debugger)

Set breakpoints at various places in a C++ program ‘star.cc’ using gdb (GNU Debugger). The program star.cc can be found in examples/tcp. Copy this program in scratch folder and follow the steps given below to start debugging a program using gdb in ns-3:

  1. Copy star.cc from examples/tcp to scratch
  2. Configure and build ns-3.
  3. Execute command: ./waf shell
  4. Execute command: gdb build/scratch/star
  5. Set breakpoints at line numbers 50, 70 and 80.
  6. List all breakpoints.
  7. Delete all breakpoints.
  8. List all breakpoints again. (Expected output: No breakpoints or watchpoints)

Provide the snapshots at each step for evaluation of the completed task.

You can refer to the video for introduction to gdb

Reference to gdb commands

Task tags

  • debugging
  • gdb
  • coding

Students who completed this task

Parth Pratim, Asanali, Victor Hu, sikfeng, Parth Pandya, winningit, Phyxkal, bartekche, FelenAmvrosiy

Task type

  • code Code
  • chrome_reader_mode Documentation / Training
close

2018