From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3520 invoked by alias); 22 Mar 2006 15:50:39 -0000 Received: (qmail 3511 invoked by uid 22791); 22 Mar 2006 15:50:38 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Mar 2006 15:50:35 +0000 Received: from fra-out-03.spheriq.net (fra-out-03.spheriq.net [195.46.51.131]) by fra-del-04.spheriq.net with ESMTP id k2MFnZSr015403 for ; Wed, 22 Mar 2006 15:50:23 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-03.spheriq.net with ESMTP id k2MFmph8010160 for ; Wed, 22 Mar 2006 15:48:52 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id k2MFmn0I006461 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 22 Mar 2006 15:48:50 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 A956EDA44; Wed, 22 Mar 2006 15:48:48 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CC9AA474BA; Wed, 22 Mar 2006 15:52:45 +0000 (GMT) Received: from [164.129.14.54] (crecy.bri.st.com [164.129.14.54]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CHJ64991 (AUTH smithc); Wed, 22 Mar 2006 15:48:46 GMT Message-ID: <442171DE.6080604@st.com> Date: Wed, 22 Mar 2006 22:01:00 -0000 From: Christopher SMITH User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050319 MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sourceware.org, Sean MCGOOGAN Subject: Re: Allocation of dwarf2_frame_state_reg_info References: <4416EC57.2000107@st.com> <20060321142041.GB15578@nevyn.them.org> In-Reply-To: <20060321142041.GB15578@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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.2.01 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00154.txt.bz2 Hi Daniel! Thanks for your reply. >>In dwarf2-frame.c:dwarf2_frame_cache(), the two >>dwarf2_frame_state_reg_infos, fs->regs and fs->initial, seem to be >>allocated by calls to dwarf2_frame_state_alloc_regs() in only some cases >>of execute_cfa_program(). In the case of the function above, none of the >>cases exercised while going through the CIE result in an allocation, >>which has the effect back in dwarf2_frame_cache() of leaving fs->initial >>unallocated, and so uninitialised. > > > Well, it's not entirely uninitialized, is it? At least it was memset > to zeroes. Sorry, I put that badly. What I was trying to say was that dwarf2_frame_state.reg wasn't initialised, not the whole dwarf2_frame_state. >>Later, when processing the FDE, a >>DW_CFA_restore is encountered which reads from fs->initial and causes >>the error... > > > dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1); > if (reg < fs->initial.num_regs) > fs->regs.reg[reg] = fs->initial.reg[reg]; > else > fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED; > > Are we looking at the same version of GDB here? Oops - no. :-( I was originally looking at the sh linux gdb, which is still based on gdb 6.3 and so doesn't check initial.num_regs. I did actually check that the code I was interested in, dwarf2_frame_cache() etc., hadn't changed but I missed that bit. My apologies - of course, this fixes the problem. Thanks for your help! Many thanks, Chris -- Chris Smith, STS Software Engineer STMicroelectronics (R&D) Ltd. 1000 Aztec West, Almondsbury, Bristol BS32 4SQ Phone: +44 1454 462358