From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22197 invoked by alias); 10 Jun 2004 21:08:03 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22189 invoked from network); 10 Jun 2004 21:08:02 -0000 Received: from unknown (HELO web50306.mail.yahoo.com) (206.190.38.60) by sourceware.org with SMTP; 10 Jun 2004 21:08:02 -0000 Message-ID: <20040610210802.93316.qmail@web50306.mail.yahoo.com> Received: from [139.55.33.52] by web50306.mail.yahoo.com via HTTP; Thu, 10 Jun 2004 14:08:02 PDT Date: Thu, 10 Jun 2004 21:08:00 -0000 From: John Subject: segmentation fault To: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-06/txt/msg00107.txt.bz2 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/