From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5250 invoked by alias); 13 Aug 2003 03:54:56 -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 5221 invoked from network); 13 Aug 2003 03:54:44 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 13 Aug 2003 03:54:44 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 347802B7F; Tue, 12 Aug 2003 23:54:32 -0400 (EDT) Message-ID: <3F39B678.70409@redhat.com> Date: Wed, 13 Aug 2003 03:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michal Ludvig , rth@redhat.com Cc: Daniel Jacobowitz , gdb Subject: Re: [testsuite & dwarf2] How to handle store.exp failure on AMD64? References: <3F3212B7.8060003@suse.cz> <20030807135035.GA28000@nevyn.them.org> <3F326928.3020502@redhat.com> <20030807150201.GA29511@nevyn.them.org> <3F3275EC.3000702@redhat.com> <3F32C75D.2010007@suse.cz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00133.txt.bz2 Ref: Dwarf unwinder problems with store.exp and preserved regs http://sources.redhat.com/ml/gdb/2003-07/msg00026.html > Andrew Cagney wrote: > For this specific ABI and problem, did GCC put the value in a preserved regiter ... > > - GCC -O0 should should not eliminate variables, and should preserve all variables across function calls. > > Given that is compiled with -O0, I think GCC is failing on count #3 here. > > or a scratch register? > > Into the preserved register (%rbx). > When I added the appropriate DW_CFA_same_value instruction to the .s file, the register was correctly unwound and the value of the variable in an upper frame shown. Ok. Looking at the debug info (bet everyones compiler is different :-/) I'm seeing a very non-descrptive CIEs vis: 00000018 00000014 ffffffff CIE Version: 1 Augmentation: "" Code alignment factor: 1 Data alignment factor: -8 Return address column: 16 DW_CFA_def_cfa: r7 ofs 8 DW_CFA_offset: r16 at cfa-8 DW_CFA_nop DW_CFA_nop DW_CFA_nop DW_CFA_nop DW_CFA_nop DW_CFA_nop I would have expected the CIE.INITIAL_INSTRUCTIONS to specify the default state of all DWARF2 registers, and not just a select few. The dwarf2 example, spells out the initial state of all registers vis: cie 32 length cie+4 0xffffffff CIE_id cie+8 1 version cie+9 0 augmentation cie+10 4 code_alignment_fact cie+11 -4 data_alignment_fact cie+12 8 R8 is the return ad cie+13 DW_CFA_def_cfa (7, 0) CFA = [R7]+0 cie+16 DW_CFA_same_value (0) R0 not modified (=0 cie+18 DW_CFA_undefined (1) R1 scratch cie+20 DW_CFA_undefined (2) R2 scratch cie+22 DW_CFA_undefined (3) R3 scratch cie+24 DW_CFA_same_value (4) R4 preserve cie+26 DW_CFA_same_value (5) R5 preserve cie+28 DW_CFA_same_value (6) R6 preserve cie+30 DW_CFA_same_value (7) R7 preserve cie+32 DW_CFA_register (8, 1) R8 is in R1 cie+35 DW_CFA_nop padding cie+36 and GCC put simply is not doing this. Andrew