8145103: [aix] implement os::print_register_info()
authorstuefe
Thu, 10 Dec 2015 14:22:00 +0100
changeset 35076 14858721b3b3
parent 35075 ca79cbf3f106
child 35077 8b86440d3bf1
8145103: [aix] implement os::print_register_info() Reviewed-by: goetz, dholmes
hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
--- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Sun Dec 13 22:32:16 2015 -0500
+++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Thu Dec 10 14:22:00 2015 +0100
@@ -546,7 +546,21 @@
 
 void os::print_register_info(outputStream *st, void *context) {
   if (context == NULL) return;
-  st->print("Not ported - print_register_info\n");
+
+  ucontext_t *uc = (ucontext_t*)context;
+
+  st->print_cr("Register to memory mapping:");
+  st->cr();
+
+  st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.iar);
+  st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.lr);
+  st->print("sp ="); print_location(st, (intptr_t)os::Aix::ucontext_get_sp(uc));
+  for (int i = 0; i < 32; i++) {
+    st->print("r%-2d=", i);
+    print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.gpr[i]);
+  }
+
+  st->cr();
 }
 
 extern "C" {
@@ -565,3 +579,4 @@
   // PPC does not require the additional stack bang.
   return 0;
 }
+