From patchwork Thu Aug 23 17:35:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Darrington X-Patchwork-Id: 29030 Received: (qmail 109562 invoked by alias); 23 Aug 2018 17:35:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 109529 invoked by uid 89); 23 Aug 2018 17:35:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*au, 0x0c, 0x0C X-HELO: jocasta.intra Received: from de.cellform.com (HELO jocasta.intra) (88.217.224.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Aug 2018 17:35:34 +0000 Received: from jocasta.intra (localhost [127.0.0.1]) by jocasta.intra (8.15.2/8.15.2/Debian-8) with ESMTPS id w7NHZVRV026209 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Aug 2018 19:35:31 +0200 Received: (from john@localhost) by jocasta.intra (8.15.2/8.15.2/Submit) id w7NHZVcj026205; Thu, 23 Aug 2018 19:35:31 +0200 From: John Darrington To: gdb-patches@sourceware.org Cc: John Darrington Subject: [PATCH 2/3] GDB: Add support for 24 bit addresses Date: Thu, 23 Aug 2018 19:35:25 +0200 Message-Id: <20180823173526.26144-2-john@darrington.wattle.id.au> In-Reply-To: <20180823173526.26144-1-john@darrington.wattle.id.au> References: <20180823173526.26144-1-john@darrington.wattle.id.au> * include/dwarf2.h (enum dwarf_unit_type)[DW_EH_PE_udata3]: New member. * gdb/dwarf2-frame.c (encoding_for_size): Deal with case 3. (read_encoded_value): Deal with case DW_EH_PE_udata3 --- gdb/dwarf2-frame.c | 7 ++++++- include/dwarf2.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index f7dc820f4d..b329e34997 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -1527,12 +1527,14 @@ encoding_for_size (unsigned int size) { case 2: return DW_EH_PE_udata2; + case 3: + return DW_EH_PE_udata3; case 4: return DW_EH_PE_udata4; case 8: return DW_EH_PE_udata8; default: - internal_error (__FILE__, __LINE__, _("Unsupported address size")); + internal_error (__FILE__, __LINE__, _("Unsupported address size %d"), size); } } @@ -1605,6 +1607,9 @@ read_encoded_value (struct comp_unit *unit, gdb_byte encoding, case DW_EH_PE_udata2: *bytes_read_ptr += 2; return (base + bfd_get_16 (unit->abfd, (bfd_byte *) buf)); + case DW_EH_PE_udata3: + *bytes_read_ptr += 3; + return (base + bfd_get_24 (unit->abfd, (bfd_byte *) buf)); case DW_EH_PE_udata4: *bytes_read_ptr += 4; return (base + bfd_get_32 (unit->abfd, (bfd_byte *) buf)); diff --git a/include/dwarf2.h b/include/dwarf2.h index cf0039a92a..05c328057b 100644 --- a/include/dwarf2.h +++ b/include/dwarf2.h @@ -474,11 +474,14 @@ enum dwarf_unit_type #define DW_EH_PE_udata2 0x02 #define DW_EH_PE_udata4 0x03 #define DW_EH_PE_udata8 0x04 + +#define DW_EH_PE_udata3 0x05 + +#define DW_EH_PE_signed 0x08 #define DW_EH_PE_sleb128 0x09 #define DW_EH_PE_sdata2 0x0A #define DW_EH_PE_sdata4 0x0B #define DW_EH_PE_sdata8 0x0C -#define DW_EH_PE_signed 0x08 #define DW_EH_PE_pcrel 0x10 #define DW_EH_PE_textrel 0x20