public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Darrington <john@darrington.wattle.id.au>
To: gdb-patches@sourceware.org
Cc: John Darrington <john@darrington.wattle.id.au>
Subject: [PATCH 2/3] GDB: Add support for 24 bit addresses
Date: Thu, 23 Aug 2018 17:35:00 -0000	[thread overview]
Message-ID: <20180823173526.26144-2-john@darrington.wattle.id.au> (raw)
In-Reply-To: <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
-- 
2.11.0

  reply	other threads:[~2018-08-23 17:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23 17:35 [PATCH 1/3] gdb: Added builtin types for 24 bit integers John Darrington
2018-08-23 17:35 ` John Darrington [this message]
2018-08-24 20:34   ` [PATCH 2/3] GDB: Add support for 24 bit addresses Simon Marchi
2018-08-25  4:56     ` John Darrington
2018-08-23 17:35 ` [PATCH 3/3] GDB: New target s12z John Darrington
2018-08-23 17:56   ` Eli Zaretskii
2018-08-26 17:19   ` Simon Marchi
2018-08-26 17:41     ` John Darrington
2018-08-26 18:16       ` Simon Marchi
2018-08-26 22:55         ` Simon Marchi
2018-08-27  6:30           ` John Darrington
2018-08-27 12:54             ` Simon Marchi
2018-08-28 15:35         ` Tom Tromey
2018-08-23 17:55 ` [PATCH 1/3] gdb: Added builtin types for 24 bit integers Eli Zaretskii
2018-08-23 19:41 ` Simon Marchi
2018-08-23 20:04   ` John Darrington
2018-08-23 20:35     ` Simon Marchi
2018-08-24  6:11       ` John Darrington
2018-08-24 15:09         ` Simon Marchi
2018-08-24 15:29           ` John Darrington
2018-08-24 20:37             ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180823173526.26144-2-john@darrington.wattle.id.au \
    --to=john@darrington.wattle.id.au \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).