8147510: [windows] no text locations shown for register info in hs-err file

Reviewed-by: dholmes, iklam
This commit is contained in:
Thomas Stuefe 2016-01-29 09:21:15 +01:00
parent 4bfa63dd34
commit 722817ba99
2 changed files with 26 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -5267,8 +5267,29 @@ bool os::check_heap(bool force) {
bool os::find(address addr, outputStream* st) {
// Nothing yet
return false;
int offset = -1;
bool result = false;
char buf[256];
if (os::dll_address_to_library_name(addr, buf, sizeof(buf), &offset)) {
st->print(PTR_FORMAT " ", addr);
if (strlen(buf) < sizeof(buf) - 1) {
char* p = strrchr(buf, '\\');
if (p) {
st->print("%s", p + 1);
} else {
st->print("%s", buf);
}
} else {
// The library name is probably truncated. Let's omit the library name.
// See also JDK-8147512.
}
if (os::dll_address_to_function_name(addr, buf, sizeof(buf), &offset)) {
st->print("::%s + 0x%x", buf, offset);
}
st->cr();
result = true;
}
return result;
}
LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {

View File

@ -599,6 +599,7 @@ void os::print_register_info(outputStream *st, const void *context) {
// this is only for the "general purpose" registers
#ifdef AMD64
st->print("RIP="); print_location(st, uc->Rip);
st->print("RAX="); print_location(st, uc->Rax);
st->print("RBX="); print_location(st, uc->Rbx);
st->print("RCX="); print_location(st, uc->Rcx);
@ -616,6 +617,7 @@ void os::print_register_info(outputStream *st, const void *context) {
st->print("R14="); print_location(st, uc->R14);
st->print("R15="); print_location(st, uc->R15);
#else
st->print("EIP="); print_location(st, uc->Eip);
st->print("EAX="); print_location(st, uc->Eax);
st->print("EBX="); print_location(st, uc->Ebx);
st->print("ECX="); print_location(st, uc->Ecx);