The 2-byte constant is the number of bytes of the DWARF expression to skip
forward or backward from the current operation, beginning after the 2-byte
constant.

Signed-off-by: Mark Wielaard <[email protected]>
---
 src/ChangeLog | 5 +++++
 src/readelf.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 9d6fbe3..9f0c525 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-16  Mark Wielaard  <[email protected]>
+
+       * readelf.c (print_ops): DW_OP_skip and DW_OP_bra targets are
+       calculated beginning after the operand and 2-byte constant.
+
 2012-10-12  Jan Kratochvil  <[email protected]>
 
        * readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
diff --git a/src/readelf.c b/src/readelf.c
index 1801c1c..7f6f31c 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -3802,7 +3802,7 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, 
int indentrest,
          NEED (2);
          printf ("%*s[%4" PRIuMAX "] %s %" PRIuMAX "\n",
                  indent, "", (uintmax_t) offset, op_name,
-                 (uintmax_t) (offset + read_2sbyte_unaligned (dbg, data)));
+                 (uintmax_t) (offset + read_2sbyte_unaligned (dbg, data) + 3));
          CONSUME (2);
          data += 2;
          offset += 3;
-- 
1.7.11.7

_______________________________________________
elfutils-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/elfutils-devel

Reply via email to