[PATCH ver2] gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame.exp
Carl Love
cel@us.ibm.com
Sat Dec 4 00:38:26 GMT 2021
GDB maintainers:
The following is an updated version of the patch based on the comments
from Will Schmidt. Also added Ulrigh to the cc list.
The following patch adds the needed Powerpc support to the
gdb.dwarf2/frame-inlined-in-outer-frame test as described below.
The patch has been tested on PowerPC LE and BE as well as X86_64 with
no failures.
Please let me know if this patch is acceptable for mainline. Thanks.
Carl
-----------------------------------------------
gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame
This patch adds an #elif defined for PowerPC to setup the exit_0 macro.
This patch addes the needed macro definitionald logic to handle both elfV1
and elfV2.
The patch has been successfully tested on both PowerPC BE, Powerpc LE and
X86_64 with no regressions.
---
.../gdb.dwarf2/frame-inlined-in-outer-frame.S | 34 +++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
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 9fb6e7b7164..ad332cfc671 100644
--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S
+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S
@@ -65,6 +65,16 @@
swi 0x0
.endm
+#elif defined __powerpc64__
+
+# define RETURN_ADDRESS_REGNO 65
+
+.macro exit_0
+ li 0, __NR_exit /* r0 - contains system call number */
+ li 3, 0 /* r3 - contains first argument for sys call */
+ sc
+.endm
+
#else
# error "Unsupported architecture"
#endif
@@ -90,8 +100,28 @@
16 }
*/
-.global _start
-_start:
+# 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
+#else
+ .global _start
+ _start:
+#endif
+
.cfi_startproc
/* State that the return address for this frame is undefined. */
--
2.30.2
More information about the Gdb-patches
mailing list