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

[ns] Tcl and C debugging in Ns



Thanks, Patrick, Tarik, Kun-Chan, Sudhindra, George, Lloyd, Alefiya.
I think that I have found where is the problem. Basically, my failure to
debug tcl and c code in gdb, is that I have not done the make for ns
correctly after I make some changes in configuration, that is, after
reconfiguring ns, "make clean" should be done before "make" again. The
following is what I have done.

1. install tcl-debug
a. put the directory of "tcl-debug-1.9" parallel to ns-2. (Actually, it
can be put somewhere else).
b. it seems that tcl-debug needs to be installed manually, instead of ns
will compile it automatically, which is the impression I have from the
nsdoc, then follow the instruction about the installation  note in
tcl-debug-1.9 directory, "./configure" and "make". It may not be necessary
to install tcl-debug to the system, since libtcldbg.a should have been
made and already in the directory "tcl-debug-1.9".

2. go into ns-2 directory and make ns again
a. ./configure --enable-debug --with-tcldebug=../tcl-debug-1.9
b. make clean
c. make

3. Tcl debugging
a. insert "debug 1" somewhere in the tcl script
b. #>gdb ns
c. (gdb)run myscript.tcl

4. C++ debugging
a. #>gdb ns
b. (gdb)break classname::memberfunction
c. (gdb)run myscript.tcl

Actually mixing tcl and c debugging can be done in gdb, described by
Sudhindra's previous mail.

I have tried the above in my linux box with redhat6.1 installed, and it
works, but I have not done any test in other platforms.

thanks
sean
--------------------------------------------------------
Hei Xiaojun						
Department of Electrical and Electronic Engineering	
Hongkong University of Science and Technology