aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-11-13 23:36:38 +0000
committerRichard Henderson <rth@redhat.com>2001-11-13 23:36:38 +0000
commit81766fcaa8cc31d66f724a84247b7e7f57af0e6c (patch)
treeb5aad7cf48a53296759ea286ca030c17352d2fd4
parent13d574884b0d270e3687829534f063961c7ee964 (diff)
downloadfsf-binutils-gdb-81766fcaa8cc31d66f724a84247b7e7f57af0e6c.zip
fsf-binutils-gdb-81766fcaa8cc31d66f724a84247b7e7f57af0e6c.tar.gz
fsf-binutils-gdb-81766fcaa8cc31d66f724a84247b7e7f57af0e6c.tar.bz2
* readelf.c (read_and_display_attr_value): New function to
handle DW_FORM_indirect. (read_and_display_attr): Use it.
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c28
2 files changed, 30 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6fc2f62..a35ea64 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-13 Keith Walker <keith.walker@arm.com>
+
+ * readelf.c (read_and_display_attr_value): New function to
+ handle DW_FORM_indirect.
+ (read_and_display_attr): Use it.
+
2001-11-13 Geoffrey Keating <geoffk@redhat.com>
* readelf.c (display_debug_lines): Deal with unknown standard
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 1d5300a..d9b71cd 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -231,6 +231,7 @@ static void free_abbrevs PARAMS ((void));
static void add_abbrev PARAMS ((unsigned long, unsigned long, int));
static void add_abbrev_attr PARAMS ((unsigned long, unsigned long));
static unsigned char * read_and_display_attr PARAMS ((unsigned long, unsigned long, unsigned char *, unsigned long, unsigned long));
+static unsigned char * read_and_display_attr_value PARAMS ((unsigned long, unsigned long, unsigned char *, unsigned long, unsigned long));
static unsigned char * display_block PARAMS ((unsigned char *, unsigned long));
static void decode_location_expression PARAMS ((unsigned char *, unsigned int, unsigned long));
static void request_dump PARAMS ((unsigned int, int));
@@ -6933,7 +6934,7 @@ decode_location_expression (data, pointer_size, length)
static unsigned char *
-read_and_display_attr (attribute, form, data, cu_offset, pointer_size)
+read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size)
unsigned long attribute;
unsigned long form;
unsigned char * data;
@@ -6944,8 +6945,6 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size)
unsigned char * block_start = NULL;
int bytes_read;
- printf (" %-18s:", get_AT_name (attribute));
-
switch (form)
{
default:
@@ -6990,6 +6989,13 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size)
uvalue = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
break;
+
+ case DW_FORM_indirect:
+ form = read_leb128 (data, & bytes_read, 0);
+ data += bytes_read;
+ printf (" %s", get_FORM_name (form));
+ return read_and_display_attr_value (attribute, form, data, cu_offset,
+ pointer_size);
}
switch (form)
@@ -7065,7 +7071,7 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size)
break;
case DW_FORM_indirect:
- warn (_("Unable to handle FORM: %d"), form);
+ /* handled above */
break;
default:
@@ -7224,6 +7230,20 @@ read_and_display_attr (attribute, form, data, cu_offset, pointer_size)
break;
}
+ return data;
+}
+
+static unsigned char *
+read_and_display_attr (attribute, form, data, cu_offset, pointer_size)
+ unsigned long attribute;
+ unsigned long form;
+ unsigned char * data;
+ unsigned long cu_offset;
+ unsigned long pointer_size;
+{
+ printf (" %-18s:", get_AT_name (attribute));
+ data = read_and_display_attr_value (attribute, form, data, cu_offset,
+ pointer_size);
printf ("\n");
return data;
}