* readelf.c (read_and_display_attr_value): New function to
authorRichard Henderson <rth@redhat.com>
Tue, 13 Nov 2001 23:36:38 +0000 (23:36 +0000)
committerRichard Henderson <rth@redhat.com>
Tue, 13 Nov 2001 23:36:38 +0000 (23:36 +0000)
        handle DW_FORM_indirect.
        (read_and_display_attr): Use it.

binutils/ChangeLog
binutils/readelf.c

index 6fc2f629b1eabb71696aae7841506e771f36e6a8..a35ea640362d924fed20b06e52790f4d31a49ce6 100644 (file)
@@ -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
index 1d5300ae85a3a28aa8ab73a0cce1203bb8bc4936..d9b71cd532c15da90197ff9ad84e06350193c922 100644 (file)
@@ -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;
 }