summaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-09-03 15:54:30 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-09-03 15:54:30 +0000
commitb644b589b0a424cd2258c08d2d4264b3862ecc3e (patch)
treed0e36b07d60a71875e524ac4cfe89ccffc53195d /binutils/dwarf.c
parent6076abd2f14d8ba301be2d2676851f6020d20076 (diff)
downloadbinutils-redhat-b644b589b0a424cd2258c08d2d4264b3862ecc3e.tar.gz
binutils/
* dwarf.c (regname): New declaration. (decode_location_expression): Print for registers also regname output. binutils/testsuite/ * binutils-all/objdump.W: Update DW_OP_reg5 expected output. gas/testsuite/ * gas/elf/dwarf2-1.d: Update DW_OP_reg5 expected output. * gas/elf/dwarf2-2.d: Likewise. * gas/i386/dw2-compress-1.d: Likewise.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 1d2679befc..599c0d2ba8 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -27,6 +27,8 @@
#include "dwarf2.h"
#include "dwarf.h"
+static const char *regname (unsigned int regno, int row);
+
static int have_frame_base;
static int need_base_address;
@@ -936,7 +938,8 @@ decode_location_expression (unsigned char * data,
case DW_OP_reg29:
case DW_OP_reg30:
case DW_OP_reg31:
- printf ("DW_OP_reg%d", op - DW_OP_reg0);
+ printf ("DW_OP_reg%d (%s)", op - DW_OP_reg0,
+ regname (op - DW_OP_reg0, 1));
break;
case DW_OP_breg0:
@@ -971,14 +974,16 @@ decode_location_expression (unsigned char * data,
case DW_OP_breg29:
case DW_OP_breg30:
case DW_OP_breg31:
- printf ("DW_OP_breg%d: %ld", op - DW_OP_breg0,
+ printf ("DW_OP_breg%d (%s): %ld", op - DW_OP_breg0,
+ regname (op - DW_OP_breg0, 1),
read_leb128 (data, &bytes_read, 1));
data += bytes_read;
break;
case DW_OP_regx:
- printf ("DW_OP_regx: %lu", read_leb128 (data, &bytes_read, 0));
+ uvalue = read_leb128 (data, &bytes_read, 0);
data += bytes_read;
+ printf ("DW_OP_regx: %lu (%s)", uvalue, regname (uvalue, 1));
break;
case DW_OP_fbreg:
need_frame_base = 1;
@@ -988,7 +993,7 @@ decode_location_expression (unsigned char * data,
case DW_OP_bregx:
uvalue = read_leb128 (data, &bytes_read, 0);
data += bytes_read;
- printf ("DW_OP_bregx: %lu %ld", uvalue,
+ printf ("DW_OP_bregx: %lu (%s) %ld", uvalue, regname (uvalue, 1),
read_leb128 (data, &bytes_read, 1));
data += bytes_read;
break;