segmentation fault
John
johnw822003@yahoo.com
Thu Jun 10 21:08:00 GMT 2004
Hi all:
Â
I encounter a segmentation fault probelm. When I use
"gdb core", gdb shows that the program stops at the
following line of my code:
sprintf(pt_->buffer() + offset,
Â
I think that line cause segmentation fault.
I want to set a breakpoint at that line and run the
code to see what happens before segmetation fault. How
can I make the program stop right before segmentation
fault happens?
I also attach some information from gdb.Â
Â
Thanks a lot.
Â
John
Â
---------------------------------------------------------------------------------
Loaded symbols for /lib/ld-linux.so.2
#0Â 0x4026ecef in vfprintf () from /lib/libc.so.6
(gdb) bt
#0Â 0x4026ecef in vfprintf () from /lib/libc.so.6
#1Â 0xbfffdd04 in ?? ()
#2Â 0x40286fcb in vsprintf () from /lib/libc.so.6
#3Â 0x4027492d in sprintf () from /lib/libc.so.6
#4Â 0x0812226b in CMUTrace::format_mac_common(Packet*,
char const*, int) (this=0x97528b8, p=0x12ef75a0,
why=0x82cc85c "---", offset=0)
   at trace/cmu-trace.cc:228
 .........
Â
(gdb) frame 4
#4Â 0x0812226b in CMUTrace::format_mac_common(Packet*,
char const*, int) (this=0x97528b8, p=0x12ef75a0,
why=0x82cc85c "---", offset=0)
   at trace/cmu-trace.cc:228
228Â Â Â Â Â Â Â Â Â Â Â Â sprintf(pt_->buffer() + offset,
Current language:Â auto; currently c++
(gdb)
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
More information about the Gdb
mailing list