8306510: Print number of threads and stack sizes in error reports

Reviewed-by: gziemski, dholmes
This commit is contained in:
Thomas Stuefe 2023-05-02 12:18:23 +00:00
parent a8d16dea8e
commit ea9201f420
4 changed files with 32 additions and 10 deletions

View file

@ -483,10 +483,11 @@ void Thread::print_on_error(outputStream* st, char* buf, int buflen) const {
OSThread* os_thr = osthread();
if (os_thr != nullptr) {
st->fill_to(67);
if (os_thr->get_state() != ZOMBIE) {
st->print(" [stack: " PTR_FORMAT "," PTR_FORMAT "]",
p2i(stack_end()), p2i(stack_base()));
st->print(" [id=%d]", osthread()->thread_id());
st->print(" [id=%d, stack(" PTR_FORMAT "," PTR_FORMAT ") (" PROPERFMT ")]",
osthread()->thread_id(), p2i(stack_end()), p2i(stack_base()),
PROPERFMTARGS(stack_size()));
} else {
st->print(" terminated");
}