This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 6/6] DWARF-5: DW_FORM_data16
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: binutils at sourceware dot org
- Cc: Victor Leschuk <vleschuk at accesssoftek dot com>
- Date: Wed, 15 Feb 2017 23:58:38 +0100
- Subject: [PATCH 6/6] DWARF-5: DW_FORM_data16
- Authentication-results: sourceware.org; auth=none
- References: <148719947800.19826.950569475344047705.stgit@host1.jankratochvil.net>
Hi,
DWARF-5 has new form DW_FORM_data16.
Jan
binutils/ChangeLog
2017-02-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf.c (read_and_display_attr_value): Support DW_FORM_data16.
---
binutils/dwarf.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 94b366b..b29ed10 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -1730,6 +1730,32 @@ read_and_display_attr_value (unsigned long attribute,
data += 8;
break;
+ case DW_FORM_data16:
+ if (!do_loc)
+ {
+ dwarf_vma left_high_bits, left_low_bits;
+ dwarf_vma right_high_bits, right_low_bits;
+
+ SAFE_BYTE_GET64 (data, &left_high_bits, &left_low_bits, end);
+ SAFE_BYTE_GET64 (data + 8, &right_high_bits, &right_low_bits, end);
+ if (byte_get == byte_get_little_endian)
+ {
+ /* Swap them. */
+ left_high_bits ^= right_high_bits;
+ right_high_bits ^= left_high_bits;
+ left_high_bits ^= right_high_bits;
+ left_low_bits ^= right_low_bits;
+ right_low_bits ^= left_low_bits;
+ left_low_bits ^= right_low_bits;
+ }
+ printf (" 0x%08" DWARF_VMA_FMT "x%08" DWARF_VMA_FMT "x"
+ "%08" DWARF_VMA_FMT "x%08" DWARF_VMA_FMT "x",
+ left_high_bits, left_low_bits, right_high_bits,
+ right_low_bits);
+ }
+ data += 16;
+ break;
+
case DW_FORM_string:
if (!do_loc)
printf ("%c%.*s", delimiter, (int) (end - data), data);