[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] how to use debugger



Hi, all!

I'd like to trace ns source code with a script (for example, 
/foo/bar/ns/ns-2.1b6/tcl/lib/simple.tcl). I tried to trace with
debugger "gdb", but I couldn't. gdb is suspended like this:

------------------------------------------------------------------------
Current directory is /foo/bar/ns/ns-2.1b6/tcl/ex/
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(gdb) l
51	 *	Whatever the application does.
52	 *
53	 *----------------------------------------------------------------------
54	 */
55	
56	int
57	main(int argc, char **argv)
58	{
59	    Tcl_Main(argc, argv, 
60		     Tcl_AppInit);
(gdb) b 59
Breakpoint 1 at 0x804aed6: file tclAppInit.cc, line 59.
(gdb) run
Starting program: /usr/local/ns/bin/ns 

Breakpoint 1, main (argc=1, argv=0xbfbffa1c) at tclAppInit.cc:60
(gdb) s
0x8141940 in Tcl_Main () at gen/ptypes.cc:112
(gdb) s
%
---------------------------------------------------------------------
I located the line "debug 1" at appropriate place, but did not work well.

Because I couldn't understand the way of debugging only by reading 
ns manual, please tell me the way in detail.
----
Minehiko Iida <[email protected]>