8217879: hs_err should print more instructions in hex dump

Reviewed-by: stuefe, coleenp, dholmes, lucy, stefank
This commit is contained in:
Aleksey Shipilev 2019-02-01 16:03:15 +01:00
parent d176e20898
commit 8f65fa9303
13 changed files with 24 additions and 23 deletions
src/hotspot

@ -561,8 +561,7 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Aix::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
print_instructions(st, pc, /*instrsize=*/4);
st->cr();
// Try to decode the instructions.

@ -1021,8 +1021,8 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Bsd::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", (intptr_t)pc);
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}
void os::print_register_info(outputStream *st, const void *context) {

@ -606,8 +606,8 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}
void os::print_register_info(outputStream *st, const void *context) {

@ -543,8 +543,8 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 32, pc + 32, Assembler::InstructionSize);
print_instructions(st, pc, Assembler::InstructionSize);
st->cr();
}
void os::print_register_info(outputStream *st, const void *context) {

@ -574,8 +574,7 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
print_instructions(st, pc, /*instrsize=*/4);
st->cr();
}

@ -605,9 +605,7 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
if (Verbose) { st->print_cr("pc at " PTR_FORMAT, p2i(pc)); }
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc-64, pc+64, /*intrsize=*/4);
print_instructions(st, pc, /*intrsize=*/4);
st->cr();
}

@ -232,8 +232,8 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}

@ -755,8 +755,8 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}
void os::print_register_info(outputStream *st, const void *context) {

@ -655,8 +655,8 @@ void os::print_context(outputStream *st, const void *context) {
// this at the end, and hope for the best.
ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc);
address pc = epc.pc();
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}
void os::print_register_info(outputStream *st, const void *context) {

@ -779,8 +779,8 @@ void os::print_context(outputStream *st, const void *context) {
// this at the end, and hope for the best.
ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc);
address pc = epc.pc();
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}
void os::print_register_info(outputStream *st, const void *context) {

@ -585,8 +585,7 @@ void os::print_context(outputStream *st, const void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = (address)uc->REG_PC;
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
print_instructions(st, pc, sizeof(char));
st->cr();
}

@ -909,6 +909,11 @@ void os::print_hex_dump(outputStream* st, address start, address end, int unitsi
st->cr();
}
void os::print_instructions(outputStream* st, address pc, int unitsize) {
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 256, pc + 256, unitsize);
}
void os::print_environment_variables(outputStream* st, const char** env_list) {
if (env_list) {
st->print_cr("Environment Variables:");

@ -640,6 +640,7 @@ class os: AllStatic {
static void print_siginfo(outputStream* st, const void* siginfo);
static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
static void print_instructions(outputStream* st, address pc, int unitsize);
static void print_location(outputStream* st, intptr_t x, bool verbose = false);
static size_t lasterror(char *buf, size_t len);