* libgo patch committed: Signal/register improvements
@ 2017-08-16 20:36 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2017-08-16 20:36 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 231 bytes --]
This patch by Tony Reix fixes dumpregs on i386 to use the right type,
implements dumpregs for PPC Linux/AIX, and retrieves the PC value on
AIX. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.
Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 3481 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 251006)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-480fdfa9dd416bd17115a94fa6021c4dd805fc39
+f02183eb66f5718769f3f6541dcc6744ae1771c0
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: libgo/runtime/go-signal.c
===================================================================
--- libgo/runtime/go-signal.c (revision 250873)
+++ libgo/runtime/go-signal.c (working copy)
@@ -224,6 +224,9 @@ getSiginfo(siginfo_t *info, void *contex
#ifdef __linux__
ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
#endif
+ #ifdef _AIX
+ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+ #endif
#endif
if (ret.sigpc == 0) {
@@ -282,19 +285,19 @@ dumpregs(siginfo_t *info __attribute__((
{
mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
- runtime_printf("eax %X\n", m->gregs[REG_EAX]);
- runtime_printf("ebx %X\n", m->gregs[REG_EBX]);
- runtime_printf("ecx %X\n", m->gregs[REG_ECX]);
- runtime_printf("edx %X\n", m->gregs[REG_EDX]);
- runtime_printf("edi %X\n", m->gregs[REG_EDI]);
- runtime_printf("esi %X\n", m->gregs[REG_ESI]);
- runtime_printf("ebp %X\n", m->gregs[REG_EBP]);
- runtime_printf("esp %X\n", m->gregs[REG_ESP]);
- runtime_printf("eip %X\n", m->gregs[REG_EIP]);
- runtime_printf("eflags %X\n", m->gregs[REG_EFL]);
- runtime_printf("cs %X\n", m->gregs[REG_CS]);
- runtime_printf("fs %X\n", m->gregs[REG_FS]);
- runtime_printf("gs %X\n", m->gregs[REG_GS]);
+ runtime_printf("eax %x\n", m->gregs[REG_EAX]);
+ runtime_printf("ebx %x\n", m->gregs[REG_EBX]);
+ runtime_printf("ecx %x\n", m->gregs[REG_ECX]);
+ runtime_printf("edx %x\n", m->gregs[REG_EDX]);
+ runtime_printf("edi %x\n", m->gregs[REG_EDI]);
+ runtime_printf("esi %x\n", m->gregs[REG_ESI]);
+ runtime_printf("ebp %x\n", m->gregs[REG_EBP]);
+ runtime_printf("esp %x\n", m->gregs[REG_ESP]);
+ runtime_printf("eip %x\n", m->gregs[REG_EIP]);
+ runtime_printf("eflags %x\n", m->gregs[REG_EFL]);
+ runtime_printf("cs %x\n", m->gregs[REG_CS]);
+ runtime_printf("fs %x\n", m->gregs[REG_FS]);
+ runtime_printf("gs %x\n", m->gregs[REG_GS]);
}
#endif
#endif
@@ -339,4 +342,37 @@ dumpregs(siginfo_t *info __attribute__((
}
#endif
#endif
+
+#ifdef __PPC__
+ #ifdef __linux__
+ {
+ mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+ int i;
+
+ for (i = 0; i < 32; i++)
+ runtime_printf("r%d %X\n", i, m->regs->gpr[i]);
+ runtime_printf("pc %X\n", m->regs->nip);
+ runtime_printf("msr %X\n", m->regs->msr);
+ runtime_printf("cr %X\n", m->regs->ccr);
+ runtime_printf("lr %X\n", m->regs->link);
+ runtime_printf("ctr %X\n", m->regs->ctr);
+ runtime_printf("xer %X\n", m->regs->xer);
+ }
+ #endif
+ #ifdef _AIX
+ {
+ mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+ int i;
+
+ for (i = 0; i < 32; i++)
+ runtime_printf("r%d %p\n", i, m->jmp_context.gpr[i]);
+ runtime_printf("pc %p\n", m->jmp_context.iar);
+ runtime_printf("msr %p\n", m->jmp_context.msr);
+ runtime_printf("cr %x\n", m->jmp_context.cr);
+ runtime_printf("lr %p\n", m->jmp_context.lr);
+ runtime_printf("ctr %p\n", m->jmp_context.ctr);
+ runtime_printf("xer %x\n", m->jmp_context.xer);
+ }
+ #endif
+#endif
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-16 19:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-16 20:36 libgo patch committed: Signal/register improvements Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).