From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15519 invoked by alias); 23 Nov 2005 09:38:35 -0000 Received: (qmail 15504 invoked by uid 22791); 23 Nov 2005 09:38:34 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-03.spheriq.net (HELO lon-del-03.spheriq.net) (195.46.50.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 23 Nov 2005 09:38:33 +0000 Received: from lon-out-03.spheriq.net ([195.46.50.131]) by lon-del-03.spheriq.net with ESMTP id jAN9cUrX019573 for ; Wed, 23 Nov 2005 09:38:30 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-03.spheriq.net with ESMTP id jAN9cT9U022016 for ; Wed, 23 Nov 2005 09:38:29 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-02.spheriq.net with ESMTP id jAN9c3rH008162 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 23 Nov 2005 09:38:11 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D0784DA88; Wed, 23 Nov 2005 09:35:39 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 5DF3147224; Wed, 23 Nov 2005 09:38:41 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 23FF075999; Wed, 23 Nov 2005 09:38:41 +0000 (UTC) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 669C7473D0; Wed, 23 Nov 2005 09:38:38 +0000 (GMT) Received: from crx549.cro.st.com (crx549.cro.st.com [164.129.44.49]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CGB25419 (AUTH "frederic riss"); Wed, 23 Nov 2005 10:35:33 +0100 (CET) Subject: Re: [RFC] DW_CFA_restore handling causes memory fault From: Frederic RISS To: Mark Kettenis Cc: jimb@red-bean.com, gdb-patches@sources.redhat.com In-Reply-To: <200511181345.jAIDjZNc026609@elgar.sibelius.xs4all.nl> References: <1132242850.8685.47.camel@crx549.cro.st.com> <8f2776cb0511171132x17fa4192u6ca5af71201e0be3@mail.gmail.com> <1132301881.8685.63.camel@crx549.cro.st.com> <8f2776cb0511180035ndadf290ta81520f75cf601d5@mail.gmail.com> <1132317183.8685.101.camel@crx549.cro.st.com> <200511181345.jAIDjZNc026609@elgar.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="=-tszZPafWmSaRJvbGLB2M" Date: Wed, 23 Nov 2005 16:51:00 -0000 Message-Id: <1132738531.7340.42.camel@crx549.cro.st.com> Mime-Version: 1.0 X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00430.txt.bz2 --=-tszZPafWmSaRJvbGLB2M Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 823 On Fri, 2005-11-18 at 14:45 +0100, Mark Kettenis wrote: > Formatted in what way? Starting in column 0? Well, that's because > it's easier to see whether the string will be longer than 80 > characters, which your string will be once the %s is filled in. I just noticed that other complaints of the file will wrap because symfile complaints are prefixed with 'During symbol reading, '. I put the line break in my patch so that the first line is no longer that 80 chars with the prefix. > So > could you split the string over two lines? You're going to have to do > that anyway, because I'm going to ask you to make a little change: can > you also print the register number for the register that the complaint > is about? Here's the latest version of the patch with the regnum printed out. Is it ok to commit ? Fred. --=-tszZPafWmSaRJvbGLB2M Content-Disposition: attachment; filename=dwarf2_cfa_restore.patch Content-Type: text/x-patch; name=dwarf2_cfa_restore.patch; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 955 2005-11-23 Frédéric Riss * dwarf2-frame.c: (execute_cfa_program): Don't access past the allocated dwarf2_frame_state.initial.regs. --- dwarf2-frame.c.orig 2005-11-23 10:19:31.000000000 +0100 +++ dwarf2-frame.c 2005-11-23 10:28:22.000000000 +0100 @@ -294,7 +294,16 @@ execute_cfa_program (gdb_byte *insn_ptr, gdb_assert (fs->initial.reg); reg = insn & 0x3f; dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1); - fs->regs.reg[reg] = fs->initial.reg[reg]; + if (reg < fs->initial.num_regs) + fs->regs.reg[reg] = fs->initial.reg[reg]; + else + fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED; + + if (fs->regs.reg[reg].how == DWARF2_FRAME_REG_UNSPECIFIED) + complaint (&symfile_complaints, _( +"incomplete CFI data; DW_CFA_restore of unspecified\n" +"registers (e.g., regnum %i) at 0x%s"), + DWARF2_REG_TO_REGNUM(reg), paddr (fs->pc)); } else { --=-tszZPafWmSaRJvbGLB2M--