aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2018-07-30 15:35:45 -0700
committerKevin Buettner <kevinb@redhat.com>2018-08-08 08:10:36 -0700
commitf384a1f025084a4a6370d7ada6dc7198ad3454e4 (patch)
tree68ea1461a61a1f519b168b2d50ee1d1989f49c16
parentf7309df20c4e787041cedc4a6aced89c15259e54 (diff)
downloadgdb-f384a1f025084a4a6370d7ada6dc7198ad3454e4.zip
gdb-f384a1f025084a4a6370d7ada6dc7198ad3454e4.tar.gz
gdb-f384a1f025084a4a6370d7ada6dc7198ad3454e4.tar.bz2
Add support for DW_OP_GNU_variable_value to readelf
As indicated by the subject, this patch adds support for the DWARF expression opcode DW_OP_GNU_variable_value to readelf. It's pretty much a copy/paste of DW_OP_call_ref with the obvious name changes for the printf statements. The FIXME comment comes from that copy/paste. binutils/ChangeLog: * dwarf.c (decode_location_expresion): Add case for DW_OP_GNU_variable_value.
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/dwarf.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 9fce7b6..6ed758b 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2018-08-08 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf.c (decode_location_expresion): Add case for
+ DW_OP_GNU_variable_value.
+
2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
* readelf.c (display_arc_attribute): Print Tag_ARC_ATR_version.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 81060bf..ad961b8 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -1575,6 +1575,25 @@ decode_location_expression (unsigned char * data,
data += bytes_read;
printf ("DW_OP_GNU_const_index <0x%s>", dwarf_vmatoa ("x", uvalue));
break;
+ case DW_OP_GNU_variable_value:
+ /* FIXME: Strictly speaking for 64-bit DWARF3 files
+ this ought to be an 8-byte wide computation. */
+ if (dwarf_version == -1)
+ {
+ printf (_("(DW_OP_GNU_variable_value in frame info)"));
+ /* No way to tell where the next op is, so just bail. */
+ return need_frame_base;
+ }
+ if (dwarf_version == 2)
+ {
+ SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end);
+ }
+ else
+ {
+ SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end);
+ }
+ printf ("DW_OP_GNU_variable_value: <0x%s>", dwarf_vmatoa ("x", uvalue));
+ break;
/* HP extensions. */
case DW_OP_HP_is_value: