< prev index next >

src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp

Print this page
rev 49276 : 8191101: Show register content in hs-err file on assert
Reviewed-by:


  34 #include "code/vtableStubs.hpp"
  35 #include "interpreter/interpreter.hpp"
  36 #include "memory/allocation.inline.hpp"
  37 #include "nativeInst_ppc.hpp"
  38 #include "os_share_linux.hpp"
  39 #include "prims/jniFastGetField.hpp"
  40 #include "prims/jvm_misc.hpp"
  41 #include "runtime/arguments.hpp"
  42 #include "runtime/extendedPC.hpp"
  43 #include "runtime/frame.inline.hpp"
  44 #include "runtime/interfaceSupport.inline.hpp"
  45 #include "runtime/java.hpp"
  46 #include "runtime/javaCalls.hpp"
  47 #include "runtime/mutexLocker.hpp"
  48 #include "runtime/osThread.hpp"
  49 #include "runtime/safepointMechanism.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/stubRoutines.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "runtime/timer.hpp"

  54 #include "utilities/events.hpp"
  55 #include "utilities/vmError.hpp"
  56 
  57 // put OS-includes here
  58 # include <sys/types.h>
  59 # include <sys/mman.h>
  60 # include <pthread.h>
  61 # include <signal.h>
  62 # include <errno.h>
  63 # include <dlfcn.h>
  64 # include <stdlib.h>
  65 # include <stdio.h>
  66 # include <unistd.h>
  67 # include <sys/resource.h>
  68 # include <pthread.h>
  69 # include <sys/stat.h>
  70 # include <sys/time.h>
  71 # include <sys/utsname.h>
  72 # include <sys/socket.h>
  73 # include <sys/wait.h>


 248   // second (transactional) context with MSR TS bits active. If the signal is
 249   // caught during a transaction, then just return to the HTM abort handler.
 250   // Please refer to Linux kernel document powerpc/transactional_memory.txt,
 251   // section "Signals".
 252   if (uc && uc->uc_link) {
 253     ucontext_t* second_uc = uc->uc_link;
 254 
 255     // MSR TS bits are 29 and 30 (Power ISA, v2.07B, Book III-S, pp. 857-858,
 256     // 3.2.1 "Machine State Register"), however note that ISA notation for bit
 257     // numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
 258     // bits 33 and 34. It's not related to endianness, just a notation matter.
 259     if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
 260       if (TraceTraps) {
 261         tty->print_cr("caught signal in transaction, "
 262                         "ignoring to jump to abort handler");
 263       }
 264       // Return control to the HTM abort handler.
 265       return true;
 266     }
 267   }







 268 
 269   JavaThread* thread = NULL;
 270   VMThread* vmthread = NULL;
 271   if (os::Linux::signal_handlers_are_installed) {
 272     if (t != NULL) {
 273       if(t->is_Java_thread()) {
 274         thread = (JavaThread*)t;
 275       } else if(t->is_VM_thread()) {
 276         vmthread = (VMThread *)t;
 277       }
 278     }
 279   }
 280 
 281   // Moved SafeFetch32 handling outside thread!=NULL conditional block to make
 282   // it work if no associated JavaThread object exists.
 283   if (uc) {
 284     address const pc = os::Linux::ucontext_get_pc(uc);
 285     if (pc && StubRoutines::is_safefetch_fault(pc)) {
 286       os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
 287       return true;




  34 #include "code/vtableStubs.hpp"
  35 #include "interpreter/interpreter.hpp"
  36 #include "memory/allocation.inline.hpp"
  37 #include "nativeInst_ppc.hpp"
  38 #include "os_share_linux.hpp"
  39 #include "prims/jniFastGetField.hpp"
  40 #include "prims/jvm_misc.hpp"
  41 #include "runtime/arguments.hpp"
  42 #include "runtime/extendedPC.hpp"
  43 #include "runtime/frame.inline.hpp"
  44 #include "runtime/interfaceSupport.inline.hpp"
  45 #include "runtime/java.hpp"
  46 #include "runtime/javaCalls.hpp"
  47 #include "runtime/mutexLocker.hpp"
  48 #include "runtime/osThread.hpp"
  49 #include "runtime/safepointMechanism.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/stubRoutines.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "runtime/timer.hpp"
  54 #include "utilities/debug.hpp"
  55 #include "utilities/events.hpp"
  56 #include "utilities/vmError.hpp"
  57 
  58 // put OS-includes here
  59 # include <sys/types.h>
  60 # include <sys/mman.h>
  61 # include <pthread.h>
  62 # include <signal.h>
  63 # include <errno.h>
  64 # include <dlfcn.h>
  65 # include <stdlib.h>
  66 # include <stdio.h>
  67 # include <unistd.h>
  68 # include <sys/resource.h>
  69 # include <pthread.h>
  70 # include <sys/stat.h>
  71 # include <sys/time.h>
  72 # include <sys/utsname.h>
  73 # include <sys/socket.h>
  74 # include <sys/wait.h>


 249   // second (transactional) context with MSR TS bits active. If the signal is
 250   // caught during a transaction, then just return to the HTM abort handler.
 251   // Please refer to Linux kernel document powerpc/transactional_memory.txt,
 252   // section "Signals".
 253   if (uc && uc->uc_link) {
 254     ucontext_t* second_uc = uc->uc_link;
 255 
 256     // MSR TS bits are 29 and 30 (Power ISA, v2.07B, Book III-S, pp. 857-858,
 257     // 3.2.1 "Machine State Register"), however note that ISA notation for bit
 258     // numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
 259     // bits 33 and 34. It's not related to endianness, just a notation matter.
 260     if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
 261       if (TraceTraps) {
 262         tty->print_cr("caught signal in transaction, "
 263                         "ignoring to jump to abort handler");
 264       }
 265       // Return control to the HTM abort handler.
 266       return true;
 267     }
 268   }
 269 
 270   #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
 271   if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
 272     handle_assert_poison_fault(ucVoid, info->si_addr);
 273     return 1;
 274   }
 275   #endif
 276 
 277   JavaThread* thread = NULL;
 278   VMThread* vmthread = NULL;
 279   if (os::Linux::signal_handlers_are_installed) {
 280     if (t != NULL) {
 281       if(t->is_Java_thread()) {
 282         thread = (JavaThread*)t;
 283       } else if(t->is_VM_thread()) {
 284         vmthread = (VMThread *)t;
 285       }
 286     }
 287   }
 288 
 289   // Moved SafeFetch32 handling outside thread!=NULL conditional block to make
 290   // it work if no associated JavaThread object exists.
 291   if (uc) {
 292     address const pc = os::Linux::ucontext_get_pc(uc);
 293     if (pc && StubRoutines::is_safefetch_fault(pc)) {
 294       os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
 295       return true;


< prev index next >