< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page
rev 53535 : 8217994: os::print_hex_dump should be more resilient against unreadable memory
Reviewed-by: XXX

*** 883,898 **** --- 883,907 ---- } address p = start; st->print(PTR_FORMAT ": ", p2i(start)); while (p < end) { + if (is_readable_pointer(p)) { switch (unitsize) { case 1: st->print("%02x", *(u1*)p); break; case 2: st->print("%04x", *(u2*)p); break; case 4: st->print("%08x", *(u4*)p); break; case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break; } + } else { + switch (unitsize) { + case 1: st->print("%2s", "??"); break; + case 2: st->print("%4s", "????"); break; + case 4: st->print("%8s", "????????"); break; + case 8: st->print("%16s", "????????????????"); break; + } + } p += unitsize; cols++; if (cols >= cols_per_line && p < end) { cols = 0; st->cr();
< prev index next >