为了找到错误所在,修改 Makefile 在
*/ns*-allinone/ns*/ folder下
1. locate the compiler command it will either be "cc" or "gcc". change
it to "cc -g" or "gcc -g". This will make the compiler generated flags
for gdb
2. Then type
>make clean
>make
this will re compile ns
3. then run ns using gdb using the command below
>gdb ns
>[inside gdb]r your-tcl-file.tcl
4. Then, when you get a seg fault , it will show you the line number
and file name which caused the Seg Fault . This will give you lot of
info to debug your code.
[NS2] Segmentation fault 错误
最新推荐文章于 2020-01-17 20:54:37 发布