From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1991 invoked by alias); 28 May 2006 05:58:59 -0000 Received: (qmail 1981 invoked by uid 22791); 28 May 2006 05:58:59 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 28 May 2006 05:58:55 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4S5u6e3003877; Sun, 28 May 2006 01:56:06 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4S5u6fP002097; Sun, 28 May 2006 01:56:06 -0400 Received: from free.oliva.athome.lsd.ic.unicamp.br (vpn50-7.rdu.redhat.com [172.16.50.7]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k4S5u5WA007951; Sun, 28 May 2006 01:56:05 -0400 Received: from free.oliva.athome.lsd.ic.unicamp.br (free.oliva.athome.lsd.ic.unicamp.br [127.0.0.1]) by free.oliva.athome.lsd.ic.unicamp.br (8.13.6/8.13.5) with ESMTP id k4S5u4K0020789; Sun, 28 May 2006 02:56:04 -0300 Received: (from aoliva@localhost) by free.oliva.athome.lsd.ic.unicamp.br (8.13.6/8.13.5/Submit) id k4S5u3h2020788; Sun, 28 May 2006 02:56:03 -0300 To: gdb-patches@sourceware.org Subject: Re: add support for =?iso-8859-1?Q?`S=B4?= augmentation in dwarf2 debug info References: <20060304150719.GD20187@nevyn.them.org> <20060328223959.GE11817@nevyn.them.org> From: Alexandre Oliva Date: Sun, 28 May 2006 06:42:00 -0000 In-Reply-To: <20060328223959.GE11817@nevyn.them.org> (Daniel Jacobowitz's message of "Tue, 28 Mar 2006 17:39:59 -0500") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b27 (linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: 2006-05/txt/msg00467.txt.bz2 --=-=-= Content-length: 338 On Mar 28, 2006, Daniel Jacobowitz wrote: > On Tue, Mar 07, 2006 at 02:23:10AM -0300, Alexandre Oliva wrote: >> If the code changes are fine without the testcase, I'll be more than >> happy to check them in as such. Are they? > Yes, the code changes are OK. Thanks and sorry for the delay. Checking this in now... --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=gdb-augmS-2.patch Content-length: 2564 for gdb/ChangeLog from Alexandre Oliva * dwarf2-frame.c (struct dwarf2_cie): Add signal_frame field. (dwarf2_frame_sniffer): Use it. (decode_frame_entry_1): Set it according to augmentation "S". Index: gdb/dwarf2-frame.c =================================================================== --- gdb/dwarf2-frame.c.orig 2006-05-28 02:42:30.000000000 -0300 +++ gdb/dwarf2-frame.c 2006-05-28 02:44:41.000000000 -0300 @@ -70,6 +70,9 @@ struct dwarf2_cie /* True if a 'z' augmentation existed. */ unsigned char saw_z_augmentation; + /* True if an 'S' augmentation existed. */ + unsigned char signal_frame; + struct dwarf2_cie *next; }; @@ -1053,15 +1056,17 @@ dwarf2_frame_sniffer (struct frame_info function. frame_pc_unwind(), for a no-return next function, can end up returning something past the end of this function's body. */ CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame); - if (!dwarf2_frame_find_fde (&block_addr)) + struct dwarf2_fde *fde = dwarf2_frame_find_fde (&block_addr); + if (!fde) return NULL; /* On some targets, signal trampolines may have unwind information. We need to recognize them so that we set the frame type correctly. */ - if (dwarf2_frame_signal_frame_p (get_frame_arch (next_frame), - next_frame)) + if (fde->cie->signal_frame + || dwarf2_frame_signal_frame_p (get_frame_arch (next_frame), + next_frame)) return &dwarf2_signal_frame_unwind; return &dwarf2_frame_unwind; @@ -1521,6 +1526,10 @@ decode_frame_entry_1 (struct comp_unit * depends on the target address size. */ cie->encoding = DW_EH_PE_absptr; + /* We'll determine the final value later, but we need to + initialize it conservatively. */ + cie->signal_frame = 0; + /* Check version number. */ cie_version = read_1_byte (unit->abfd, buf); if (cie_version != 1 && cie_version != 3) @@ -1604,6 +1613,17 @@ decode_frame_entry_1 (struct comp_unit * augmentation++; } + /* "S" indicates a signal frame, such that the return + address must not be decremented to locate the call frame + info for the previous frame; it might even be the first + instruction of a function, so decrementing it would take + us to a different function. */ + else if (*augmentation == 'S') + { + cie->signal_frame = 1; + augmentation++; + } + /* Otherwise we have an unknown augmentation. Bail out unless we saw a 'z' prefix. */ else --=-=-= Content-length: 249 -- Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/ Secretary for FSF Latin America http://www.fsfla.org/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org} --=-=-=--