Fix dw2-ifort-parameter.exp on PPC64
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 7 Mar 2014 12:23:47 +0000 (12:23 +0000)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Wed, 12 Mar 2014 15:22:19 +0000 (16:22 +0100)
On PPC64, 'func' and 'main' are function descriptors and don't point
to the actual code.  Thus the usage of these symbols in the DWARF
assembler source was broken.  The patch introduces new labels
func_start and func_end for this purpose.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp

index 2452c77fe751392447fbff9ae3d42bc609023540..56275a3aa12c50de0ca579c596143900ee2a6d4e 100644 (file)
@@ -1,3 +1,11 @@
+2014-03-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * gdb.dwarf2/dw2-ifort-parameter.c (func): Define labels
+       'func_start' and 'func_end' for the beginning and end of the
+       function code, respectively.
+       * gdb.dwarf2/dw2-ifort-parameter.exp: Use 'func_start' and
+       'func_end' instead of 'func' and 'main'.
+
 2014-03-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * gdb.dwarf2/dw2-ifort-parameter-debug.S: Remove.
index 361c44d8ae4f3b7f926c1d79b64d607adcbe179d..447481476794a2fe534a840d37424e988313825c 100644 (file)
 int value = 0xdeadf00d;
 int *ptr = &value;
 
-void
+asm (".section \".text\"");
+asm (".balign 8");
+asm ("func_start: .globl func_start");
+
+static void
 func (void)
 {
 }
 
+asm ("func_end: .globl func_end");
+
 int
 main (void)
 {
index d11de9ed3184b4d7a1ba826baa4fd67896ec744d..026e071e7c1709d48776701b9c5d144c0b96e570 100644 (file)
@@ -29,14 +29,14 @@ set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
     declare_labels int_label
 
-    extern main func ptr
+    extern func_start func_end ptr
 
     cu {} {
        compile_unit {
            {name file1.txt}
            {language @DW_LANG_C}
-           {low_pc func addr}
-           {high_pc main addr}
+           {low_pc func_start addr}
+           {high_pc func_end addr}
        } {
            int_label: base_type {
                {name int}
@@ -47,8 +47,8 @@ Dwarf::assemble $asm_file {
            subprogram {
                {external 1 flag}
                {name func}
-               {low_pc func addr}
-               {high_pc main addr}
+               {low_pc func_start addr}
+               {high_pc func_end addr}
            } {
                formal_parameter {
                    {name param}
This page took 0.038937 seconds and 4 git commands to generate.