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

Re: [ns] How to debug c++ code of ns?



when building ns you need to run configure with the flag to the enable
debugging code.

./configure --enable-debug

make



Yi-Hsien Tseng wrote:
> 
> Hi all:
>          I use gdb to debug ns code!
>          But I have a problem as following:
>         ---------------------------------------------------------------
>          $gdb ns
>          (gdb)run test.tcl
>                   .
>                   .
>                   .
>           stop in Mac::recv(),segment fall...core dump!
> 
>          (gdb)list
>           9959 out of range, there are 2295 lines total!
>          --------------------------------------------------------------
> 
>          I know the code is in mac.cc,but how can I list the code of mac.cc??
>          use (gdb)load mac.cc , right??
> 
>         And can anyone can tell me the most common instruction using in gdb when debuging ns2?
> 
>         Thank you !
> 
>          Best Regard !