debug.cpp revision 2796
986N/A * or visit www.oracle.com if you need additional information or have any
986N/A#include "precompiled.hpp"
986N/A#include "classfile/systemDictionary.hpp"
986N/A#include "code/codeCache.hpp"
986N/A#include "code/icBuffer.hpp"
986N/A#include "code/nmethod.hpp"
986N/A#include "code/vtableStubs.hpp"
986N/A#include "compiler/compileBroker.hpp"
986N/A#include "compiler/disassembler.hpp"
986N/A#include "gc_implementation/shared/markSweep.hpp"
986N/A#include "gc_interface/collectedHeap.hpp"
986N/A#include "interpreter/bytecodeHistogram.hpp"
986N/A#include "interpreter/interpreter.hpp"
986N/A#include "memory/resourceArea.hpp"
1185N/A#include "memory/universe.hpp"
1185N/A#include "oops/oop.inline.hpp"
986N/A#include "prims/privilegedStack.hpp"
986N/A#include "runtime/arguments.hpp"
986N/A#include "runtime/sharedRuntime.hpp"
986N/A#include "runtime/stubCodeGenerator.hpp"
986N/A#include "runtime/stubRoutines.hpp"
986N/A#include "runtime/vframe.hpp"
1185N/A#include "services/heapDumper.hpp"
1185N/A#include "utilities/defaultStream.hpp"
1185N/A#include "utilities/events.hpp"
986N/A#include "utilities/vmError.hpp"
986N/A#ifdef TARGET_OS_FAMILY_linux
986N/A# include "os_linux.inline.hpp"
1185N/A# include "thread_linux.inline.hpp"
1185N/A# include "os_solaris.inline.hpp"
1185N/A# include "thread_solaris.inline.hpp"
986N/A# include "os_windows.inline.hpp"
1185N/A# include "thread_windows.inline.hpp"
1185N/A#ifdef TARGET_OS_FAMILY_bsd
1185N/A# include "os_bsd.inline.hpp"
1185N/A# include "thread_bsd.inline.hpp"
1185N/A ASSERT should be defined when _DEBUG is defined. It is not intended to be used for debugging
1185N/A if (PrintWarnings) {
1185N/A if (!is_error_reported()) {
986N/A const char* detail_msg)
986N/A if (first_time_here) {
static const char* flag[] = {
if (HeapDumpOnOutOfMemoryError) {
static bool error_reported = false;
void set_error_reported() {
error_reported = true;
bool is_error_reported() {
return error_reported;
#ifndef PRODUCT
#include <signal.h>
if (test_num == 0) return;
// Keep this in sync with test/runtime/6888954/vmerrors.sh.
default: ShouldNotReachHere();
#ifndef PRODUCT
bool debug_save;
static int level;
Debugging = true;
if (level++ > 0) return;
if (nm) {
if (!safe) {
p->print();
if (p->has_last_Java_frame()) {
p->trace_stack();
pd_ps(f);
p->print();
if (p->has_last_Java_frame()) {
p->print_frame_layout();
p->print();
if (p->has_last_Java_frame()) {
p->trace_frames();
WizardMode = true;
PrintCompilation = false;
#ifndef VALIDATE_MARK_SWEEP
tty->print_cr("Requires build with VALIDATE_MARK_SWEEP defined (debug build) and RecordMarkSweepCompaction enabled");
const char* _target;
findref(x);
void help() {
tty->print_cr(" find(intptr_t x) - finds & prints nmethod/stub/bytecode/oop based on pointer into it");
enum CommandID {
struct CommandParser {
char *name;
char *description;
(char *)0, CMDID_ILLEGAL
void get_debug_command()
bool gotcommand;
methodOop m;
gotcommand = false;
if ( count >=0 ) {
gotcommand = true;
case CMDID_PS:
ps();
case CMDID_PSS:
pss();
case CMDID_PSF:
psf();
case CMDID_FINDM:
case CMDID_FINDNM:
case CMDID_PP:
case CMDID_EXIT:
exit(0);
case CMDID_HELP:
case CMDID_QUIT:
case CMDID_BPT:
case CMDID_VERIFY:
verify();;
case CMDID_THREADS:
threads();;
case CMDID_HSFIND:
case CMDID_ILLEGAL: