8144192: Enhancements-to-print_siginfo-windows

Some small enhancement to os::print_siginfo for Windows

Reviewed-by: dholmes
This commit is contained in:
Thomas Stuefe 2015-12-05 05:15:35 -05:00
parent ff732e0835
commit 679e48d459

View File

@ -1801,25 +1801,33 @@ void os::print_memory_info(outputStream* st) {
void os::print_siginfo(outputStream *st, void *siginfo) { void os::print_siginfo(outputStream *st, void *siginfo) {
EXCEPTION_RECORD* er = (EXCEPTION_RECORD*)siginfo; EXCEPTION_RECORD* er = (EXCEPTION_RECORD*)siginfo;
st->print("siginfo:"); st->print("siginfo:");
st->print(" ExceptionCode=0x%x", er->ExceptionCode);
if (er->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && char tmp[64];
if (os::exception_name(er->ExceptionCode, tmp, sizeof(tmp)) == NULL) {
strcpy(tmp, "EXCEPTION_??");
}
st->print(" %s (0x%x)", tmp, er->ExceptionCode);
if ((er->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ||
er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR) &&
er->NumberParameters >= 2) { er->NumberParameters >= 2) {
switch (er->ExceptionInformation[0]) { switch (er->ExceptionInformation[0]) {
case 0: st->print(", reading address"); break; case 0: st->print(", reading address"); break;
case 1: st->print(", writing address"); break; case 1: st->print(", writing address"); break;
case 8: st->print(", data execution prevention violation at address"); break;
default: st->print(", ExceptionInformation=" INTPTR_FORMAT, default: st->print(", ExceptionInformation=" INTPTR_FORMAT,
er->ExceptionInformation[0]); er->ExceptionInformation[0]);
} }
st->print(" " INTPTR_FORMAT, er->ExceptionInformation[1]); st->print(" " INTPTR_FORMAT, er->ExceptionInformation[1]);
} else if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR &&
er->NumberParameters >= 2 && UseSharedSpaces) { if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR && UseSharedSpaces) {
FileMapInfo* mapinfo = FileMapInfo::current_info(); FileMapInfo* mapinfo = FileMapInfo::current_info();
if (mapinfo->is_in_shared_space((void*)er->ExceptionInformation[1])) { if (mapinfo->is_in_shared_space((void*)er->ExceptionInformation[1])) {
st->print("\n\nError accessing class data sharing archive." \ st->print("\n\nError accessing class data sharing archive." \
" Mapped file inaccessible during execution, " \ " Mapped file inaccessible during execution, " \
" possible disk/network problem."); " possible disk/network problem.");
} }
}
} else { } else {
int num = er->NumberParameters; int num = er->NumberParameters;
if (num > 0) { if (num > 0) {