Fix "readelf -wi" test
authorNick Clifton <nickc@redhat.com>
Wed, 23 Apr 2003 17:36:08 +0000 (17:36 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 23 Apr 2003 17:36:08 +0000 (17:36 +0000)
binutils/ChangeLog
binutils/readelf.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/readelf.exp
binutils/testsuite/binutils-all/readelf.wi
binutils/testsuite/binutils-all/testprog.c

index ec73a37864e95ece9137d87d50821b703182a0ad..0f3a282de064dc4f7b0d9058a71c462a82abb864 100644 (file)
@@ -1,3 +1,7 @@
+2003-04-23  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * readelf.c (decode_location_expression): Don't add a trailing ';'.
+
 2003-04-23  Dimitrie O. Paun <dpaun@rogers.com>
             Nick Clifton  <nickc@redhat.com>
 
index f66ea42dd444038d31beda13bb75d80e151a97f0..8d4917a7cb207bb1e1183143e84b3dbf2a56b0ab 100644 (file)
@@ -7727,7 +7727,8 @@ decode_location_expression (data, pointer_size, length)
        }
 
       /* Separate the ops.  */
-      printf ("; ");
+      if (data < end)
+       printf ("; ");
     }
 }
 
index f69caef92f841d2077f0d394c1da1d0d5ccde2ff..162708f2d1c11eb9a8aaa06fd8cbf8e9e8a370c0 100644 (file)
@@ -1,3 +1,16 @@
+2003-04-23  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.exp (proc prune_readelf_warnings): New function.
+       (proc readelf_test): Prune warning messages.
+       (readelf_test -wi): Add more expected failures.
+       * readelf.wi: Severly reduce expected output.
+       * testprog.c (string): Explicitly use unsigned chars.
+       (stdio.h, string.h): Remove inclusion.
+
+2003-04-23  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * readelf.wi: Update.
+
 2003-04-22  Dimitrie O. Paun  <dpaun@rogers.com>
 
        * binutils-all/windres/windres.exp: Add test for the new -J
index 059955d01c7821ac78b2a9a7e658267c7dd7dca1..a76620d4fb78be5324dcb6cb03bd7cb5b6ca2071 100644 (file)
@@ -164,6 +164,12 @@ proc readelf_find_size { binary_file } {
     pass $testname
 }
 
+# Simple proc to skip certain expected warning messages.
+proc prune_readelf_warnings { text } {
+    regsub -all "(^|\n)(.*Skipping unexpected symbol type.*)" $text "\\1" text
+    return $text
+}
+
 # Run an individual readelf test.
 # Basically readelf is run on the binary_file with the given options.
 # Readelf's output is captured and then compared against the contents
@@ -183,10 +189,13 @@ proc readelf_test { options binary_file regexp_file xfails } {
     foreach xfail $xfails {
        setup_xfail $xfail
     }
+
+    set got [prune_readelf_warnings $got]
     
     if ![string match "" $got] then {
+       fail "readelf $options (reason: unexpected output)"
        send_log $got
-       fail "readelf $options"
+       send_log "\n"
        return
     }
 
@@ -288,4 +297,4 @@ if [is_remote host] {
 # The xfail targets here do not default to DWARF2 format debug information
 # The symptom is that the output of 'readelf -wi' is empty.
 
-readelf_test -wi $tempfile readelf.wi {v850*-*-* cris-*-* mips*-*-elf* *-*-linux* h8300*-*-*}
+readelf_test -wi $tempfile readelf.wi {v850*-*-* cris-*-* mips*-*-elf* avr-*-* d30v-*-* h8300*-*-* i960-*-* m32r-*-* sparc-*-*}
index d76e649e224ccd737d52a4d0276ce286baacf109..b46cce5851c1b0a9b3d42a5198b2387d51be6a5c 100644 (file)
@@ -4,73 +4,26 @@ The section .debug_info contains:
    Length:        .*
    Version:       2
    Abbrev Offset: 0
-   Pointer Size:  4
+   Pointer Size:  .
  <.><.*>: Abbrev Number: .* \(DW_TAG_compile_unit\)
-     DW_AT_name        : .*/testprog.c 
-     DW_AT_comp_dir    : .*/binutils   
-     DW_AT_producer    : GNU C .*      
-     DW_AT_language    : 1     \(ANSI C\)
-     DW_AT_low_pc      : 0     
-     DW_AT_high_pc     : .*    
      DW_AT_stmt_list   : 0     
- <.><.*>: Abbrev Number: 2 \(DW_TAG_subprogram\)
+     DW_AT_high_pc     : .*    
+     DW_AT_low_pc      : 0.*   
+     DW_AT_producer    :.*
+     DW_AT_language    : 1     \(ANSI C\)
+     DW_AT_name        : .*
+ <.><.*>: Abbrev Number: .* \(DW_TAG_subprogram\)
      DW_AT_external    : 1     
      DW_AT_name        : fn    
      DW_AT_decl_file   : 1     
-     DW_AT_decl_line   : 10    
+     DW_AT_decl_line   : 12    
      DW_AT_type        : .*    
-     DW_AT_low_pc      : 0     
+     DW_AT_low_pc      : 0.*   
      DW_AT_high_pc     : .*    
-     DW_AT_frame_base  : 1 byte block: .*
- <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\)
+     DW_AT_frame_base  : .*
+ <.><.*>: Abbrev Number: .* \(DW_TAG_base_type\)
      DW_AT_name        : int   
-     DW_AT_byte_size   : 4     
-     DW_AT_encoding    : 5     \(signed\)
- <.><.*>: Abbrev Number: 4 \(DW_TAG_subprogram\)
-     DW_AT_sibling     : .*    
-     DW_AT_external    : 1     
-     DW_AT_name        : main  
-     DW_AT_decl_file   : 1     
-     DW_AT_decl_line   : 16    
-     DW_AT_type        : .*    
-     DW_AT_low_pc      : .*    
-     DW_AT_high_pc     : .*    
-     DW_AT_frame_base  : 1 byte block: .*
- <.><.*>: Abbrev Number: 5 \(DW_TAG_lexical_block\)
-     DW_AT_low_pc      : .*    
-     DW_AT_high_pc     : .*    
- <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\)
-     DW_AT_name        : common        
-     DW_AT_decl_file   : 1     
-     DW_AT_decl_line   : 3     
-     DW_AT_type        : <.*>  
-     DW_AT_external    : 1     
-     DW_AT_location    : 5 byte block: 3 0 0 0 0       \(DW_OP_addr: 0\)
- <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\)
-     DW_AT_name        : global        
-     DW_AT_decl_file   : 1     
-     DW_AT_decl_line   : 4     
-     DW_AT_type        : <.*>  
-     DW_AT_external    : 1     
-     DW_AT_location    : 5 byte block: 3 0 0 0 0       \(DW_OP_addr: 0\)
- <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\)
-     DW_AT_name        : local 
-     DW_AT_decl_file   : 1     
-     DW_AT_decl_line   : 5     
-     DW_AT_type        : <.*>  
-     DW_AT_location    : 5 byte block: 3 . 0 0 .       \(DW_OP_addr: .\)
- <.><.*>: Abbrev Number: 8 \(DW_TAG_array_type\)
-     DW_AT_sibling     : <.*>  
-     DW_AT_type        : <.*>  
- <.><.*>: Abbrev Number: 9 \(DW_TAG_subrange_type\)
-     DW_AT_upper_bound : 6     
- <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\)
-     DW_AT_name        : char  
-     DW_AT_byte_size   : 1     
-     DW_AT_encoding    : 8     \(unsigned char\)
- <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\)
-     DW_AT_name        : string        
-     DW_AT_decl_file   : 1     
-     DW_AT_decl_line   : 6     
-     DW_AT_type        : <.*>  
-     DW_AT_location    : 5 byte block: 3 . 0 0 .       \(DW_OP_addr: .\)
+     DW_AT_byte_size   : .*
+     DW_AT_encoding    : .*    \(signed\)
+ <.><.*>: Abbrev Number: .* \(DW_TAG_subprogram\)
+#pass
index 57de4610a60237b687a2a2470f0b30199c2658df..2a347c887e82fbe27f8f06ad800fe66faffb5396 100644 (file)
@@ -1,12 +1,11 @@
-/* This program is used to test objcopy and strip.  */
+/* This program is used to test objcopy, readelf and strip.  */
 
-#include <stdio.h>
-#include <string.h>
+extern int strcmp (char *, const char *);
 
 int common;
 int global = 1;
 static int local = 2;
-static char string[] = "string";
+static unsigned char string[] = "string";
 
 int
 fn ()
This page took 0.034421 seconds and 4 git commands to generate.