< prev index next >

src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp

Print this page
rev 48556 : 8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
Reviewed-by:

@@ -106,10 +106,14 @@
 
 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
   uc->uc_mcontext.psw.addr = (unsigned long)pc;
 }
 
+address ucontext_get_lr(const ucontext_t * uc) {
+  return (address)uc->uc_mcontext.gregs[14/*LINK*/];
+}
+
 intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
   return (intptr_t*)uc->uc_mcontext.gregs[15/*REG_SP*/];
 }
 
 intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {

@@ -163,13 +167,13 @@
       // Not sure where the pc points to, fallback to default
       // stack overflow handling. In compiled code, we bang before
       // the frame is complete.
       return false;
     } else {
-      intptr_t* fp = os::Linux::ucontext_get_fp(uc);
       intptr_t* sp = os::Linux::ucontext_get_sp(uc);
-      *fr = frame(sp, (address)*sp);
+      address lr = ucontext_get_lr(uc);
+      *fr = frame(sp, lr);
       if (!fr->is_java_frame()) {
         assert(fr->safe_for_sender(thread), "Safety check");
         assert(!fr->is_first_frame(), "Safety check");
         *fr = fr->java_sender();
       }
< prev index next >