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

[ns] Problem in using gdb




Dear ns-users,

I'm using gdb to debug a ns program(ccip.tcl, ccip.cc, ccip.h).
I ran "$make clean"  and removed configure.cache and ran $configure 
with "--enable-debug" option. And then recompiled all the sources by "make".
In gdb 4.16, I set a breakpoint and run my program, but
have the following error message that I couldn't figure out. 
===
warning: shared library handler failed to enable breakpoint
Cannot insert breakpoint 1:
Cannot access memory at address 0x268.
===
Can someone help me how to handle this error?
I'll appreciate any comment.
Regards,

============= full script from gdb ===============
manet.antd [100]{.../ns/ns-2}---> gdb ns
GDB is free software and you are welcome to 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.
GDB 4.16 (sparc-sun-solaris2.6), 
Copyright 1996 Free Software Foundation, Inc...
(gdb) file ccip.o
Load new symbol table from "ccip.o"? (y or n) y
Reading symbols from ccip.o...done.
(gdb) l 55, 61
Can't find a default source file
(gdb) l 55,61

55
56      void CCIP_Agent::recv(Packet* p, Handler *) {
57	     Tcl& tcl = Tcl::instance();
58	      hdr_ccip *ciph = hdr_ccip::access(p);
59              hdr_ip *iph = hdr_ip::access(p);
60              int nodeaddr = Address::instance().get_nodeaddr(addr());
61
(gdb) break 57
Breakpoint 1 at 0x268: file ccip.cc, line 57.
(gdb) info breakpoints
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00000268 ccip.cc:57
(gdb) run ccip.tcl
Starting program: /import/fs1/home/disk2/hchoi/ns/ns-2/ccip.o ccip.tcl
warning: shared library handler failed to enable breakpoint
Cannot insert breakpoint 1:
Cannot access memory at address 0x268.
(gdb) info sharedlibrary
No shared libraries loaded at this time.
(gdb) sharedlibrary
(gdb) run ccip.tcl
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /import/fs1/home/disk2/hchoi/ns/ns-2/ccip.o ccip.tcl
warning: shared library handler failed to enable breakpoint
Cannot insert breakpoint 1:
Cannot access memory at address 0x268.
(gdb)

===============
Hoon Choi
Advanced Network Technologies Division, NIST
820 West Diamond Av.
Gaithersburg, MD 20899-8920, U.S.A.
[email protected] / (Phone) 301-975-8429 / (Fax) 301-590-0932