< prev index next >

src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp

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


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

  52 #include "utilities/events.hpp"
  53 #include "utilities/vmError.hpp"
  54 
  55 // Linux/Sparc has rather obscure naming of registers in sigcontext
  56 // different between 32 and 64 bits
  57 #define SIG_PC(x) ((x)->sigc_regs.tpc)
  58 #define SIG_NPC(x) ((x)->sigc_regs.tnpc)
  59 #define SIG_REGS(x) ((x)->sigc_regs)
  60 
  61 // those are to reference registers in sigcontext
  62 enum {
  63   CON_G0 = 0,
  64   CON_G1,
  65   CON_G2,
  66   CON_G3,
  67   CON_G4,
  68   CON_G5,
  69   CON_G6,
  70   CON_G7,
  71   CON_O0,


 495   os::ThreadCrashProtection::check_crash_protection(sig, t);
 496 
 497   SignalHandlerMark shm(t);
 498 
 499   // Note: it's not uncommon that JNI code uses signal/sigset to install
 500   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 501   // or have a SIGILL handler when detecting CPU type). When that happens,
 502   // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
 503   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 504   // that do not require siginfo/ucontext first.
 505 
 506   if (sig == SIGPIPE || sig == SIGXFSZ) {
 507     // allow chained handler to go first
 508     if (os::Linux::chained_handler(sig, info, ucVoid)) {
 509       return true;
 510     } else {
 511       // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
 512       return true;
 513     }
 514   }







 515 
 516   JavaThread* thread = NULL;
 517   VMThread* vmthread = NULL;
 518   if (os::Linux::signal_handlers_are_installed) {
 519     if (t != NULL ){
 520       if(t->is_Java_thread()) {
 521         thread = (JavaThread*)t;
 522       }
 523       else if(t->is_VM_thread()){
 524         vmthread = (VMThread *)t;
 525       }
 526     }
 527   }
 528 
 529   // decide if this trap can be handled by a stub
 530   address stub = NULL;
 531   address pc = NULL;
 532   address npc = NULL;
 533 
 534   //%note os_trap_1




  32 #include "code/icBuffer.hpp"
  33 #include "code/vtableStubs.hpp"
  34 #include "interpreter/interpreter.hpp"
  35 #include "memory/allocation.inline.hpp"
  36 #include "nativeInst_sparc.hpp"
  37 #include "os_share_linux.hpp"
  38 #include "prims/jniFastGetField.hpp"
  39 #include "prims/jvm_misc.hpp"
  40 #include "runtime/arguments.hpp"
  41 #include "runtime/extendedPC.hpp"
  42 #include "runtime/frame.inline.hpp"
  43 #include "runtime/interfaceSupport.inline.hpp"
  44 #include "runtime/java.hpp"
  45 #include "runtime/javaCalls.hpp"
  46 #include "runtime/mutexLocker.hpp"
  47 #include "runtime/osThread.hpp"
  48 #include "runtime/sharedRuntime.hpp"
  49 #include "runtime/stubRoutines.hpp"
  50 #include "runtime/thread.inline.hpp"
  51 #include "runtime/timer.hpp"
  52 #include "utilities/debug.hpp"
  53 #include "utilities/events.hpp"
  54 #include "utilities/vmError.hpp"
  55 
  56 // Linux/Sparc has rather obscure naming of registers in sigcontext
  57 // different between 32 and 64 bits
  58 #define SIG_PC(x) ((x)->sigc_regs.tpc)
  59 #define SIG_NPC(x) ((x)->sigc_regs.tnpc)
  60 #define SIG_REGS(x) ((x)->sigc_regs)
  61 
  62 // those are to reference registers in sigcontext
  63 enum {
  64   CON_G0 = 0,
  65   CON_G1,
  66   CON_G2,
  67   CON_G3,
  68   CON_G4,
  69   CON_G5,
  70   CON_G6,
  71   CON_G7,
  72   CON_O0,


 496   os::ThreadCrashProtection::check_crash_protection(sig, t);
 497 
 498   SignalHandlerMark shm(t);
 499 
 500   // Note: it's not uncommon that JNI code uses signal/sigset to install
 501   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 502   // or have a SIGILL handler when detecting CPU type). When that happens,
 503   // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
 504   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 505   // that do not require siginfo/ucontext first.
 506 
 507   if (sig == SIGPIPE || sig == SIGXFSZ) {
 508     // allow chained handler to go first
 509     if (os::Linux::chained_handler(sig, info, ucVoid)) {
 510       return true;
 511     } else {
 512       // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
 513       return true;
 514     }
 515   }
 516 
 517   #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
 518   if ( (sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
 519     handle_assert_poison_fault(ucVoid, info->si_addr);
 520     return 1;
 521   }
 522   #endif
 523 
 524   JavaThread* thread = NULL;
 525   VMThread* vmthread = NULL;
 526   if (os::Linux::signal_handlers_are_installed) {
 527     if (t != NULL ){
 528       if(t->is_Java_thread()) {
 529         thread = (JavaThread*)t;
 530       }
 531       else if(t->is_VM_thread()){
 532         vmthread = (VMThread *)t;
 533       }
 534     }
 535   }
 536 
 537   // decide if this trap can be handled by a stub
 538   address stub = NULL;
 539   address pc = NULL;
 540   address npc = NULL;
 541 
 542   //%note os_trap_1


< prev index next >