[PATCH ver3] gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame.exp

Carl Love cel@us.ibm.com
Wed Dec 8 20:49:44 GMT 2021


Ulrich, Simon:

It looks like I tested Simon's last patch suggestion on a Power 9LE
machine not the Power 8BE machine as intended. I verified that the
current mainline version of the frame-inlined-in-outer-frame does not
work on Power 8 BE. 

 I created the following patch to revert back to the version of the
patch with the _start symbol in the the Power LE, BE and default #if
clauses.  The patch was then retested on Power 10 LE and Power 8BE to
verify the updated patch is working correctly.

Sorry for messing up the previous testing.  Please let me know if you
see any additional issues with this patch or the assembly code file. 
Thanks.

                                                   Carl 

---------------------------------------------------------------------
-------------------------------
gdb fix elfv1 Powerpc gdb.dwarf2/frame-inlined-in-outer-frame.exp

On ELFv1, the _start symbol must point to the *function descriptor* (in
the .opd section), not to the function code (in the .text section) like
with ELFv2 and other architectures.

Patch retested on Power 10 LE and Power 8 BE systems.  Test passes on both
systems.
---
 gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S
index 224b50b20a5..112788a3440 100644
--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S
+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S
@@ -103,19 +103,24 @@
 #if defined __powerpc64__
 #  if _CALL_ELF == 2
 .abiversion 2   /* Tell gdb what ELF version to use. */
+.global _start
+_start:
 #  else
 .abiversion 1   /* Tell gdb what ELF version to use. */
 .align 2
+.global _start
 .section ".opd", "aw"
 .align 3
+_start:
 .quad ._start,.TOC.@tocbase,0
 .previous
 .type ._start,@function
 ._start:
 #  endif
-#endif
+#else
 .global _start
 _start:
+#endif
 .cfi_startproc
 
 /* State that the return address for this frame is undefined. */
-- 
2.25.1



More information about the Gdb-patches mailing list