How to debug the Ns3 with ddd (gdb)?

1,762 views
Skip to first unread message

fbil

unread,
Dec 25, 2008, 2:43:37 AM12/25/08
to ns-3-users
Dear All

I know that i can use the command
./waf --run scratch/third --command-template="gdb %s"
to debug the Ns3 with gdb or ddd.

However, almost all .h source codes can not be reached during the
debugging.
For example, i can not trace in the mobility-helper.cc.
I can only open the .h sources while i debug it.

Does any know what the problem is?
Should i add some flag while i make the ns3 by waf?

Many thanks!

Best,
Scott

Mathieu Lacage

unread,
Dec 25, 2008, 4:15:08 AM12/25/08
to ns-3-...@googlegroups.com

The following should work:

./waf --shell
gdb ./build/debug/examples/my-program

Mathieu


fbil

unread,
Dec 25, 2008, 10:59:10 AM12/25/08
to ns-3-users
It works! :)

On 12月25日, 下午5時15分, Mathieu Lacage <mathieu.lac...@sophia.inria.fr>
wrote:

pdbarnes

unread,
Dec 19, 2013, 5:42:49 PM12/19/13
to ns-3-...@googlegroups.com
I do

$ ./waf --run first --command-template="ddd %s"

Select this menu:  File->Open Source…
Start typing the source file name:  first
Type <return> to filter the list, then select the source file.

Peter

On Monday, December 9, 2013 1:12:26 PM UTC-8, K' Dash wrote:
When I write these commands

./waf --run scratch/first --command-template="gdb %s"

OR

./waf --run scratch/first --command-template="ddd %s"


the ddd and gdb told me that there is no such file exists in the directory. you can see the out put below

>ns-allinone-3.18.1/ns-3.18.1/build/scratch/first: No such file or directory. :(


I put this NS3 "first.cc" example in scratch folder but ddd and gdb unable to get this file.
Is there any way to see ".cc" extension file in ddd/gdb?

please help. thanx in advance

K' Dash

unread,
Dec 9, 2013, 4:12:26 PM12/9/13
to ns-3-...@googlegroups.com
When I write these commands

./waf --run scratch/first --command-template="gdb %s"

OR

./waf --run scratch/first --command-template="ddd %s"


the ddd and gdb told me that there is no such file exists in the directory. you can see the out put below

>ns-allinone-3.18.1/ns-3.18.1/build/scratch/first: No such file or directory. :(


I put this NS3 "first.cc" example in scratch folder but ddd and gdb unable to get this file.
Is there any way to see ".cc" extension file in ddd/gdb?

please help. thanx in advance


On Thursday, December 25, 2008 12:43:37 PM UTC+5, fbil wrote:

ELKAMEL RABIAA

unread,
Jan 15, 2017, 12:50:54 PM1/15/17
to ns-3-users
hi i need help  to correct this error
./waf --run scratch/leach  --command-template="ddd %s" i run this comande under my terminal but i have this error

Waf: Leaving directory `/home/mohamed/repos/ns-allinone-3.19/ns-3.19/build'
'build' finished successfully (3.488s)
Traceback (most recent call last):
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 155, in run_commands
    run_command('shutdown')
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 146, in run_command
    ctx.execute()
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Context.py", line 87, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/wscript", line 922, in shutdown
    visualize=Options.options.visualize)
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/wutils.py", line 215, in run_program
    return run_argv(execvec, env, cwd=cwd)
  File "/home/mohamed/repos/ns-allinone-3.19/ns-3.19/wutils.py", line 132, in run_argv
    retval = subprocess.Popen(argv, env=proc_env, cwd=cwd).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Tommaso Pecorella

unread,
Jan 15, 2017, 6:41:35 PM1/15/17
to ns-3-users
Please read the posting guidelines.

T.
Reply all
Reply to author
Forward
0 new messages