[From NS-User]
Hao, ok, so to enable debug information in ns, you need to do the following: in your ns-allinone directory, edit the install file. Look for the line : # Build Tcl8.3.2 (should be around line 173) In this section you need to add the option --enable-symbols to the line : ./configure --enable-gcc --disable-shared --prefix=$CUR_PATH || .... so it becomes: ./configure --enable-gcc --enable-symbols --disable-shared --prefix=$CUR_PATH || .... Now, still in the ns-allinone/install file, look for the tclcl section. # Build tclcl (should be around line 260) in this section, you need to add --enable-debug to your configure line, such that: ./configure || ... becomes ./configure --enable-debug || ... ok, we're done with this one. save and close. now, go into your ns-allinone/ns directory, and open your Makefile.in. Search for CFLAGS (should be around line 90), and change it from CFLAGS = $(CCOPT) $(DEFINE) to CFLAGS = -g $(CCOPT) $(DEFINE) ok, we're done with the editing. now go to your ns-allinone and type ./install. after everything is done, you should have debugging symbols enabled. so, now you recompile your code into ns, and open ns in gdb (gdb ns) and set the appropriate parameters to ns (e.g. your .tcl simulation file), and type run. When the app crashes, type bt to see the stack. you should see plenty of debug information now. let me know how it goes. gustavo -- . g u s t a v o z a e r a . web............ www_dot_zaera_dot_net email.......... gustavo_at_zaera_dot_net "My goal is to make any information available from anywhere, at anytime."
'Computer_language > Debug' 카테고리의 다른 글
The Network Simulator ns-2: Debugging Tips (0) | 2009.01.12 |
---|---|
Pedro Vale Estrela - NS2 Debugging Page (0) | 2009.01.12 |
NS2 Programming (0) | 2009.01.12 |
ns2 gdb debug 관련 파일 (0) | 2009.01.12 |
Pedro Vale Estrela - NS2 Debug / BugFix Tutorial (OTCL + C++) (0) | 2009.01.12 |