< prev index next >
src/hotspot/share/utilities/debug.cpp
Print this page
8205199: more Linux clang compile failures
Contributed-by: <Arthur Eubanks> aeubanks@google.com, Thomas Stuefe <thomas.stuefe@gmail.com>
Reviewed-by: dholmes, kbarrett, stuefe
*** 712,746 ****
g_assert_poison = page;
}
}
}
! static bool store_context(const void* context) {
! if (memcpy(&g_stored_assertion_context, context, sizeof(ucontext_t)) == false) {
! return false;
! }
#if defined(__linux) && defined(PPC64)
// on Linux ppc64, ucontext_t contains pointers into itself which have to be patched up
// after copying the context (see comment in sys/ucontext.h):
*((void**) &g_stored_assertion_context.uc_mcontext.regs) = &(g_stored_assertion_context.uc_mcontext.gp_regs);
#endif
- return true;
}
bool handle_assert_poison_fault(const void* ucVoid, const void* faulting_address) {
if (faulting_address == g_assert_poison) {
// Disarm poison page.
os::protect_memory((char*)g_assert_poison, os::vm_page_size(), os::MEM_PROT_RWX);
// Store Context away.
if (ucVoid) {
const intx my_tid = os::current_thread_id();
if (Atomic::cmpxchg(my_tid, &g_asserting_thread, (intx)0) == 0) {
! if (store_context(ucVoid)) {
g_assertion_context = &g_stored_assertion_context;
}
}
- }
return true;
}
return false;
}
#endif // CAN_SHOW_REGISTERS_ON_ASSERT
--- 712,742 ----
g_assert_poison = page;
}
}
}
! static void store_context(const void* context) {
! memcpy(&g_stored_assertion_context, context, sizeof(ucontext_t));
#if defined(__linux) && defined(PPC64)
// on Linux ppc64, ucontext_t contains pointers into itself which have to be patched up
// after copying the context (see comment in sys/ucontext.h):
*((void**) &g_stored_assertion_context.uc_mcontext.regs) = &(g_stored_assertion_context.uc_mcontext.gp_regs);
#endif
}
bool handle_assert_poison_fault(const void* ucVoid, const void* faulting_address) {
if (faulting_address == g_assert_poison) {
// Disarm poison page.
os::protect_memory((char*)g_assert_poison, os::vm_page_size(), os::MEM_PROT_RWX);
// Store Context away.
if (ucVoid) {
const intx my_tid = os::current_thread_id();
if (Atomic::cmpxchg(my_tid, &g_asserting_thread, (intx)0) == 0) {
! store_context(ucVoid);
g_assertion_context = &g_stored_assertion_context;
}
}
return true;
}
return false;
}
#endif // CAN_SHOW_REGISTERS_ON_ASSERT
< prev index next >