From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2008 invoked by alias); 23 Jun 2008 16:57:19 -0000 Received: (qmail 1999 invoked by uid 22791); 23 Jun 2008 16:57:18 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Jun 2008 16:56:58 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KApLb-0004gn-DQ for gdb@sources.redhat.com; Mon, 23 Jun 2008 16:56:55 +0000 Received: from mobius.qnx.com ([209.226.137.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Jun 2008 16:56:55 +0000 Received: from aristovski by mobius.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Jun 2008 16:56:55 +0000 To: gdb@sources.redhat.com From: Aleksandar Ristovski Subject: Re: How to catch GDB crash Date: Mon, 23 Jun 2008 16:57:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00218.txt.bz2 Dmitry Smirnov wrote: > Hi, > > I've encountered the very annoying problem with GDB. While debugging, it crashes for some reason and I cannot catch this moment. I have a possibility to attach to the running process with another GDB, but it does not help. Perhaps, there is some way to catch some system exception or something similar? > > I'm using a litle bit complex setup, so there is no much freedom (at least I cannot simplify the situation). First, I'm debugging from Eclipse (and it looks this crash happens only while running from Eclipse, I've tried from commad line - there is no crash). The debugger I'm using is cross-compiled arm-elf-gdb. It is compiled on windows (i686) platform: > GNU gdb (GDB) 6.8.50.20080620 > ... > This GDB was configured as "--host=i686-pc-cygwin --target=arm-elf". > > I doubt this can be linked to GDB version. I recall I've seen this crash earlier with arm-elf-gdb 6.5 from GNUARM. I was just skipped this crash somehow but now I cannot continue my job. > Hello, I am working on a problem that might be related (although gdb version I am using is 6.7). Could you try with this sample code? (from cmd line, set a breakpoint in printSimple and once the breakpoint is hit do 'print p' and see if the output makes sense). Thanks, Aleksandar Ristovski QNX Software Systems #include #include struct participant { char name[15]; char country[15]; float score; int age; }; void printSimpleP(struct participant *p) { printf("Name: %s, Country: %s, Score: %f, Age: %d\n", p->name, p->country, p->score, p->age); } void printSimple(struct participant p) { printSimpleP(&p); } int main(int argc, char *argv[]) { struct participant p = { "Foo", "Bar", 1.2, 45 }; printSimple(p); return 0; }