Debug with command line arguments

631 views
Skip to first unread message

K

unread,
Sep 10, 2013, 5:52:07 PM9/10/13
to ns-3-...@googlegroups.com
Hi,

I'm trying to run script with gdb while passing it command line arguments, but it looks like I can't do it. For example, if I run first.cc with command line argument, I will do

>./waf --run "first --ns3::PointToPointNetDevice::DataRate=10Mbps"

If I run first.cc with gdb, I'll do
>./waf --run first --command-template="gdb %s"

But I can't do them  together like
>./waf --run "first --ns3::PointToPointNetDevice::DataRate=10Mbps" --command-template="gdb %s"

Any idea, or suggestion?


Kelly

Konstantinos

unread,
Sep 11, 2013, 4:16:43 AM9/11/13
to ns-3-...@googlegroups.com
Hi,

The proper command for the debug is:

./waf --run <program> --command-template="gdb %s <args>"

So in your case

./waf --run first  --command-template="gdb %s --ns3::PointToPointNetDevice::DataRate=10Mbps"

K

unread,
Sep 11, 2013, 11:49:13 AM9/11/13
to ns-3-...@googlegroups.com
Thanks for the response. After a few tries, the complete format is
./waf --run first  --command-template="gdb --args %s --ns3::PointToPointNetDevice::DataRate=10Mbps"

Kelly
Reply all
Reply to author
Forward
0 new messages