aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
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 /binutils/readelf.c
parent13d574884b0d270e3687829534f063961c7ee964 (diff)
downloadgdb-81766fcaa8cc31d66f724a84247b7e7f57af0e6c.zip
gdb-81766fcaa8cc31d66f724a84247b7e7f57af0e6c.tar.gz
gdb-81766fcaa8cc31d66f724a84247b7e7f57af0e6c.tar.bz2
* readelf.c (read_and_display_attr_value): New function to
handle DW_FORM_indirect. (read_and_display_attr): Use it.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c28
1 files changed, 24 insertions, 4 deletions
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;
}