8207342: error occurred during error reporting (printing register info)

Os::print_location misses a check if the pointer is readable.

Reviewed-by: goetz, coleenp
This commit is contained in:
Martin Doerr 2018-07-18 11:27:14 +02:00
parent 3380b0d0ef
commit d5a05363ef
9 changed files with 69 additions and 61 deletions

View file

@ -628,7 +628,19 @@ void os::print_context(outputStream *st, const void *context) {
}
void os::print_register_info(outputStream *st, const void *context) {
st->print("Not ported\n");
if (context == NULL) return;
const ucontext_t *uc = (const ucontext_t*)context;
st->print_cr("Register to memory mapping:");
st->cr();
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.psw.addr);
for (int i = 0; i < 16; i++) {
st->print("r%-2d=", i);
print_location(st, uc->uc_mcontext.gregs[i]);
}
st->cr();
}
#ifndef PRODUCT