From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29660 invoked by alias); 5 Aug 2010 16:52:01 -0000 Received: (qmail 29429 invoked by uid 22791); 5 Aug 2010 16:51:59 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Aug 2010 16:51:53 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id o75GpoZD009036 for ; Thu, 5 Aug 2010 16:51:50 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o75GpnD21511430 for ; Thu, 5 Aug 2010 18:51:49 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o75GpngC002460 for ; Thu, 5 Aug 2010 18:51:49 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o75GpmTo002448 for ; Thu, 5 Aug 2010 18:51:48 +0200 Message-Id: <201008051651.o75GpmTo002448@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 05 Aug 2010 18:51:48 +0200 Subject: Re: [rfa] frame address size incorrect if address size != ptr size To: gdb-patches@sourceware.org Date: Thu, 05 Aug 2010 16:52:00 -0000 From: "Ulrich Weigand" In-Reply-To: <20100805153010.GG4610@calimero.vinschen.de> from "Corinna Vinschen" at Aug 05, 2010 05:30:10 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00042.txt.bz2 Corinna Vinschen wrote: > Index: dwarf2-frame.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v > retrieving revision 1.114 > diff -u -p -r1.114 dwarf2-frame.c > --- dwarf2-frame.c 7 Jul 2010 17:26:38 -0000 1.114 > +++ dwarf2-frame.c 5 Aug 2010 15:25:27 -0000 > @@ -1732,13 +1732,6 @@ decode_frame_entry_1 (struct comp_unit * > depends on the target address size. */ > cie->encoding = DW_EH_PE_absptr; > > - /* The target address size. For .eh_frame FDEs this is considered > - equal to the size of a target pointer. For .dwarf_frame FDEs, > - this is supposed to be the target address size from the associated > - CU header. FIXME: We do not have a good way to determine the > - latter. Always use the target pointer size for now. */ > - cie->addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; > - > /* We'll determine the final value later, but we need to > initialize it conservatively. */ > cie->signal_frame = 0; > @@ -1779,7 +1772,7 @@ decode_frame_entry_1 (struct comp_unit * > } > else > { > - cie->addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; > + cie->addr_size = gdbarch_dwarf2_addr_size (gdbarch); > cie->segment_size = 0; > } Ah, wait a minute -- now we're missing the distinction between .eh_frame and .debug_frame again. For .eh_frame, FDE encodings needs to keep using ptr_bit as discussed earlier, even on targets that do define a non-default gdbarch_dwarf2_addr_size. Sorry for not noticing earlier. In fact, this means we might as well fix the inconsistent use between addr_size as input to read_encoded_value (which needs to be ptr_size on .eh_frame and addr_size on .debug_frame), and addr_size as input to execute_stack_op (which needs to be addr_size always). Could you add a second variable ptr_size to struct dwarf2_cie, and initialize it (after the addr_size initialization) along the lines of: if (eh_frame_p) cie->ptr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; else cie->ptr_size = cie->addr_size; and then change all calls to read_encoded_value throughout dwarf2-frame.c to pass cie->ptr_size instead of cie->addr_size. It would then be interesting to see whether *both* .debug_frame and .eh_frame work on xstormy16 ... you might be able to try the latter by building with -fasynchronous-unwind-tables. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com