mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8191049: Add alternate version of pns() that is callable from within hotspot source
Added pns2() to debug.cpp Reviewed-by: stuefe, gthornbr
This commit is contained in:
parent
b70a8ea0f4
commit
2fa7cd4d09
1 changed files with 21 additions and 0 deletions
|
@ -631,6 +631,27 @@ extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack
|
|||
VMError::print_native_stack(tty, fr, t, buf, sizeof(buf));
|
||||
}
|
||||
|
||||
//
|
||||
// This version of pns() will not work when called from the debugger, but is
|
||||
// useful when called from within hotspot code. The advantages over pns()
|
||||
// are not having to pass in any arguments, and it will work on Windows/x64.
|
||||
//
|
||||
// WARNING: Only intended for use when debugging. Do not leave calls to
|
||||
// pns2() in committed source (product or debug).
|
||||
//
|
||||
extern "C" void pns2() { // print native stack
|
||||
Command c("pns2");
|
||||
static char buf[O_BUFLEN];
|
||||
if (os::platform_print_native_stack(tty, NULL, buf, sizeof(buf))) {
|
||||
// We have printed the native stack in platform-specific code,
|
||||
// so nothing else to do in this case.
|
||||
} else {
|
||||
Thread* t = Thread::current_or_null();
|
||||
frame fr = os::current_frame();
|
||||
VMError::print_native_stack(tty, fr, t, buf, sizeof(buf));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue