From: John <johnw822003@yahoo.com>
To: gdb@sources.redhat.com
Subject: segmentation fault
Date: Thu, 10 Jun 2004 21:08:00 -0000 [thread overview]
Message-ID: <20040610210802.93316.qmail@web50306.mail.yahoo.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1444 bytes --]
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/
next reply other threads:[~2004-06-10 21:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-10 21:08 John [this message]
2006-11-11 1:21 Oliver Block
2006-11-11 20:29 ` Raúl Huertas
2006-11-11 20:46 ` Daniel Jacobowitz
2006-11-11 21:02 ` Raúl Huertas
2006-11-11 1:23 Oliver Block
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040610210802.93316.qmail@web50306.mail.yahoo.com \
--to=johnw822003@yahoo.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox