From: Richard Henderson Date: Tue, 13 Nov 2001 23:36:38 +0000 (+0000) Subject: * readelf.c (read_and_display_attr_value): New function to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81766fcaa8cc31d66f724a84247b7e7f57af0e6c;p=binutils-gdb.git * readelf.c (read_and_display_attr_value): New function to handle DW_FORM_indirect. (read_and_display_attr): Use it. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 6fc2f629b1e..a35ea640362 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2001-11-13 Keith Walker + + * 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 * readelf.c (display_debug_lines): Deal with unknown standard diff --git a/binutils/readelf.c b/binutils/readelf.c index 1d5300ae85a..d9b71cd532c 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; }