[arm] Fix fails in dw2-compdir-oldgcc.exp
authorYao Qi <yao@codesourcery.com>
Sat, 22 Nov 2014 13:22:01 +0000 (21:22 +0800)
committerYao Qi <yao@codesourcery.com>
Sat, 22 Nov 2014 13:22:01 +0000 (21:22 +0800)
This patch fixes two fails in dw2-compdir-oldgcc.exp I've seen on arm
target thumb mode.

  FAIL: gdb.dwarf2/dw2-compdir-oldgcc.exp: info source gcc42
  FAIL: gdb.dwarf2/dw2-compdir-oldgcc.exp: info source gcc43

When fill in DW_AT_low_pc, the label should be used rather than the
function, otherwise, the LSB bit of the address in DW_AT_low_pc is
set and the debug info is wrong.  This patch is to add two labels for
functions gcc42 and gcc43 respectively, and use them.  These two
fails are fixed.

gdb/testsuite:

2014-11-22  Yao Qi  <yao@codesourcery.com>

* gdb.dwarf2/dw2-compdir-oldgcc.S: Define label .Lgcc42_procstart
and .Lgcc43_procstart.  Use .Lgcc42_procstart instead of gcc42.
Use .Lgcc43_procstart instead of gcc43.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S

index 4b4d88159a39bd39a7e61ce88ffd793bf3463473..7b490eeb624749ce7955cd31c290abcf72d758be 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-22  Yao Qi  <yao@codesourcery.com>
+
+       * gdb.dwarf2/dw2-compdir-oldgcc.S: Define label .Lgcc42_procstart
+       and .Lgcc43_procstart.  Use .Lgcc42_procstart instead of gcc42.
+       Use .Lgcc43_procstart instead of gcc43.
+
 2014-11-21  Joel Brobecker  <brobecker@adacore.com>
 
        * gdb.ada/n_arr_bound: New testcase.
index c0a55453c7b4f7e844139af098b3c946a1c628ac..c07ecb2d7ce115accbae74f4d6566bb7519986e8 100644 (file)
 main:  .globl main
 
 gcc42: .globl gcc42
+.Lgcc42_procstart:
        .int 0
        .type gcc42, %function
        .size gcc42, . - gcc42
 .Lgcc42_procend:
 
 gcc43: .globl gcc43
+.Lgcc43_procstart:
        .int 0
        .type gcc43, %function
        .size gcc43, . - gcc43
@@ -43,7 +45,7 @@ gcc43:        .globl gcc43
 
        .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
        .4byte  .Lgcc42_begin                   /* DW_AT_stmt_list */
-       .4byte  gcc42                           /* DW_AT_low_pc */
+       .4byte  .Lgcc42_procstart               /* DW_AT_low_pc */
        .4byte  .Lgcc42_procend                 /* DW_AT_high_pc */
        .ascii  "/dir/d/dw2-compdir-oldgcc42.S\0"       /* DW_AT_name */
        .ascii  "GNU C 4.2.0\0"                 /* DW_AT_producer */
@@ -54,7 +56,7 @@ gcc43:        .globl gcc43
        .byte           1                       /* DW_AT_decl_file */
        .byte           1                       /* DW_AT_decl_line */
        .ascii          "gcc42\0"               /* DW_AT_name */
-       .4byte          gcc42                   /* DW_AT_low_pc */
+       .4byte          .Lgcc42_procstart       /* DW_AT_low_pc */
        .4byte          .Lgcc42_procend         /* DW_AT_high_pc */
 
        .byte           0                       /* End of children of CU */
@@ -70,7 +72,7 @@ gcc43:        .globl gcc43
 
        .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
        .4byte  .Lgcc43_begin                   /* DW_AT_stmt_list */
-       .4byte  gcc43                           /* DW_AT_low_pc */
+       .4byte  .Lgcc43_procstart               /* DW_AT_low_pc */
        .4byte  .Lgcc43_procend                 /* DW_AT_high_pc */
        .ascii  "/dir/d/dw2-compdir-oldgcc43.S\0"       /* DW_AT_name */
        .ascii  "GNU C 4.3.0\0"                 /* DW_AT_producer */
@@ -81,7 +83,7 @@ gcc43:        .globl gcc43
        .byte           1                       /* DW_AT_decl_file */
        .byte           1                       /* DW_AT_decl_line */
        .ascii          "gcc43\0"               /* DW_AT_name */
-       .4byte          gcc43                   /* DW_AT_low_pc */
+       .4byte          .Lgcc43_procstart       /* DW_AT_low_pc */
        .4byte          .Lgcc43_procend         /* DW_AT_high_pc */
 
        .byte           0                       /* End of children of CU */