From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9163 invoked by alias); 1 Jun 2003 06:07:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9124 invoked from network); 1 Jun 2003 06:07:58 -0000 Received: from unknown (HELO are.twiddle.net) (64.81.246.98) by sources.redhat.com with SMTP; 1 Jun 2003 06:07:58 -0000 Received: from are.twiddle.net (localhost.localdomain [127.0.0.1]) by are.twiddle.net (8.12.8/8.12.8) with ESMTP id h5167wLH002296 for ; Sat, 31 May 2003 23:07:58 -0700 Received: (from rth@localhost) by are.twiddle.net (8.12.8/8.12.8/Submit) id h5167w0m002294 for gdb-patches@sources.redhat.com; Sat, 31 May 2003 23:07:58 -0700 X-Authentication-Warning: are.twiddle.net: rth set sender to rth@twiddle.net using -f Date: Sun, 01 Jun 2003 06:07:00 -0000 From: Richard Henderson To: gdb-patches@sources.redhat.com Subject: [RFA] skip fde augmentation Message-ID: <20030601060757.GA2224@twiddle.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-06/txt/msg00006.txt.bz2 Found by inspection. I assume that the bulk of the dwarf2 testing has been done on C code. C++ code that handles exceptions would wind up executing bogus CFA opcodes. Ok? r~ * dwarf2-frame.c (struct dwarf2_cie): Add saw_z_augmentation. (decode_frame_entry): Set it. Skip FDE augmentation. --- dwarf2-frame.c.orig 2003-05-31 22:23:54.000000000 -0700 +++ dwarf2-frame.c 2003-05-31 22:30:21.000000000 -0700 @@ -65,6 +65,9 @@ struct dwarf2_cie /* Encoding of addresses. */ unsigned char encoding; + /* True if a 'z' augmentation existed. */ + unsigned char saw_z_augmentation; + struct dwarf2_cie *next; }; @@ -1111,7 +1114,8 @@ decode_frame_entry (struct comp_unit *un cie->return_address_register = read_1_byte (unit->abfd, buf); buf += 1; - if (*augmentation == 'z') + cie->saw_z_augmentation = (*augmentation == 'z'); + if (cie->saw_z_augmentation) { ULONGEST length; @@ -1200,6 +1204,18 @@ decode_frame_entry (struct comp_unit *un read_encoded_value (unit, fde->cie->encoding & 0x0f, buf, &bytes_read); buf += bytes_read; + /* A 'z' augmentation in the CIE implies the presence of an + augmentation field in the FDE as well. The only thing known + to be in here at present is the LSDA entry for EH. So we + can skip the whole thing. */ + if (fde->cie->saw_z_augmentation) + { + ULONGEST length; + + length = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); + buf += bytes_read + length; + } + fde->instructions = buf; fde->end = end;