From 6ba911d64ea05a6507bcf88a8ca656088a30ba5a Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 5 May 2021 12:44:26 +0000 Subject: [PATCH] 8266498: Make debug ps() call print_stack Reviewed-by: stuefe, lfoltan --- src/hotspot/share/utilities/debug.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp index 347d90cc5a5..fe8367a17ba 100644 --- a/src/hotspot/share/utilities/debug.cpp +++ b/src/hotspot/share/utilities/debug.cpp @@ -501,12 +501,9 @@ extern "C" JNIEXPORT void ps() { // print stack if (p->has_last_Java_frame()) { // If the last_Java_fp is set we are in C land and // can call the standard stack_trace function. -#ifdef PRODUCT p->print_stack(); - } else { - tty->print_cr("Cannot find the last Java frame, printing stack disabled."); -#else // !PRODUCT - p->trace_stack(); +#ifndef PRODUCT + if (Verbose) p->trace_stack(); } else { frame f = os::current_frame(); RegisterMap reg_map(p); @@ -514,9 +511,8 @@ extern "C" JNIEXPORT void ps() { // print stack tty->print("(guessing starting frame id=" PTR_FORMAT " based on current fp)\n", p2i(f.id())); p->trace_stack_from(vframe::new_vframe(&f, ®_map, p)); f.pd_ps(); -#endif // PRODUCT +#endif } - } extern "C" JNIEXPORT void pfl() { @@ -604,14 +600,6 @@ extern "C" JNIEXPORT nmethod* findnm(intptr_t addr) { return CodeCache::find_nmethod((address)addr); } -// Another interface that isn't ambiguous in dbx. -// Can we someday rename the other find to hsfind? -extern "C" JNIEXPORT void hsfind(intptr_t x) { - Command c("hsfind"); - os::print_location(tty, x, false); -} - - extern "C" JNIEXPORT void find(intptr_t x) { Command c("find"); os::print_location(tty, x, false);