How do I run NS3 via gdb in emacs? I can't get it to work... Thanks!
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
Hello,
I do not think that this way of running gdb in emacs is somehow more
usable than running gdb in a normal shell. You can debug ns3 simulation under
emacs+gdb by attaching to a running simulation.
Just run your simulation with the use of "./waf --run simulation_name" as you
did it before. Next check the PID of process created by waf. If you grep for
the name of your simulation you will get at least a list of two processes, the
first one is the waf process and the second is the process of your simulation,
you need the PID of the second.
Next run emacs, type M-x gdb RET gdb --annotate=3 RET attach PID RET.
You can yet set some breakpoints. To attach to a process you have to have
rights to send a signal to it, also sudo emacs may help you.
--
Regards,
Rafal Mielniczuk
with my simulation there where no problems because it was long. Maybe you
can add something like that before the simulation start:
int i = 1;
while(i){
sleep(5);
}
Next after attaching with gdb to process you may change the value of i with
set i=0. I have not tested it but it should work for you.
Can you explain more precisely how you use this combination of ./waf and
shell. Maybe my emacs configuration is somehow broken and I can not get this
way to work.
Regards,
Rafal Mielniczuk
Regards,
Rafal Mielniczuk
it should be "set var i = 0".
I've tried the way of running the simulation described by you and I think
it is better than mine. You don't need to modify the simulation.
Thanks.
Regards,
Rafal Mielniczuk