src/share/vm/runtime/os.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6970683 Cdiff src/share/vm/runtime/os.cpp

src/share/vm/runtime/os.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 734,752 **** // before printf. We lost some precision, but who cares? st->print_cr("elapsed time: %d seconds", (int)t); } // moved from debug.cpp (used to be find()) but still called from there ! // The print_pc parameter is only set by the debug code in one case ! void os::print_location(outputStream* st, intptr_t x, bool print_pc) { address addr = (address)x; CodeBlob* b = CodeCache::find_blob_unsafe(addr); if (b != NULL) { if (b->is_buffer_blob()) { // the interpreter is generated into a buffer blob InterpreterCodelet* i = Interpreter::codelet_containing(addr); if (i != NULL) { i->print_on(st); return; } if (Interpreter::contains(addr)) { st->print_cr(INTPTR_FORMAT " is pointing into interpreter code" --- 734,753 ---- // before printf. We lost some precision, but who cares? st->print_cr("elapsed time: %d seconds", (int)t); } // moved from debug.cpp (used to be find()) but still called from there ! // The verbose parameter is only set by the debug code in one case ! void os::print_location(outputStream* st, intptr_t x, bool verbose) { address addr = (address)x; CodeBlob* b = CodeCache::find_blob_unsafe(addr); if (b != NULL) { if (b->is_buffer_blob()) { // the interpreter is generated into a buffer blob InterpreterCodelet* i = Interpreter::codelet_containing(addr); if (i != NULL) { + st->print_cr(INTPTR_FORMAT " is an Interpreter codelet", addr); i->print_on(st); return; } if (Interpreter::contains(addr)) { st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
*** 753,770 **** " (not bytecode specific)", addr); return; } // if (AdapterHandlerLibrary::contains(b)) { ! st->print_cr("Printing AdapterHandler"); AdapterHandlerLibrary::print_handler_on(st, b); } // the stubroutines are generated into a buffer blob StubCodeDesc* d = StubCodeDesc::desc_for(addr); if (d != NULL) { d->print_on(st); ! if (print_pc) st->cr(); return; } if (StubRoutines::contains(addr)) { st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) " "stub routine", addr); --- 754,771 ---- " (not bytecode specific)", addr); return; } // if (AdapterHandlerLibrary::contains(b)) { ! st->print_cr(INTPTR_FORMAT " is an AdapterHandler", addr); AdapterHandlerLibrary::print_handler_on(st, b); } // the stubroutines are generated into a buffer blob StubCodeDesc* d = StubCodeDesc::desc_for(addr); if (d != NULL) { d->print_on(st); ! if (verbose) st->cr(); return; } if (StubRoutines::contains(addr)) { st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) " "stub routine", addr);
*** 779,789 **** if (v != NULL) { v->print_on(st); return; } } ! if (print_pc && b->is_nmethod()) { ResourceMark rm; st->print("%#p: Compiled ", addr); ((nmethod*)b)->method()->print_value_on(st); st->print(" = (CodeBlob*)" INTPTR_FORMAT, b); st->cr(); --- 780,790 ---- if (v != NULL) { v->print_on(st); return; } } ! if (verbose && b->is_nmethod()) { ResourceMark rm; st->print("%#p: Compiled ", addr); ((nmethod*)b)->method()->print_value_on(st); st->print(" = (CodeBlob*)" INTPTR_FORMAT, b); st->cr();
*** 810,819 **** --- 811,821 ---- } else if (p == NULL && ((oopDesc*)addr)->is_oop()) { p = (HeapWord*) addr; print = true; } if (print) { + st->print_cr(INTPTR_FORMAT " is an oop", addr); oop(p)->print_on(st); if (p != (HeapWord*)x && oop(p)->is_constMethod() && constMethodOop(p)->contains(addr)) { Thread *thread = Thread::current(); HandleMark hm(thread);
*** 853,887 **** // Check for privilege stack if (thread->privileged_stack_top() != NULL && thread->privileged_stack_top()->contains(addr)) { st->print_cr(INTPTR_FORMAT " is pointing into the privilege stack " "for thread: " INTPTR_FORMAT, addr, thread); ! thread->print_on(st); return; } // If the addr is a java thread print information about that. if (addr == (address)thread) { thread->print_on(st); return; } // If the addr is in the stack region for this thread then report that // and print thread info if (thread->stack_base() >= addr && addr > (thread->stack_base() - thread->stack_size())) { st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: " INTPTR_FORMAT, addr, thread); ! thread->print_on(st); return; } } // Try an OS specific find if (os::find(addr, st)) { return; } ! st->print_cr(INTPTR_FORMAT " is pointing to unknown location", addr); } // Looks like all platforms except IA64 can use the same function to check // if C stack is walkable beyond current frame. The check for fp() is not // necessary on Sparc, but it's harmless. --- 855,893 ---- // Check for privilege stack if (thread->privileged_stack_top() != NULL && thread->privileged_stack_top()->contains(addr)) { st->print_cr(INTPTR_FORMAT " is pointing into the privilege stack " "for thread: " INTPTR_FORMAT, addr, thread); ! if (verbose) thread->print_on(st); return; } // If the addr is a java thread print information about that. if (addr == (address)thread) { + if (verbose) { thread->print_on(st); + } else { + st->print_cr(INTPTR_FORMAT " is a thread", addr); + } return; } // If the addr is in the stack region for this thread then report that // and print thread info if (thread->stack_base() >= addr && addr > (thread->stack_base() - thread->stack_size())) { st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: " INTPTR_FORMAT, addr, thread); ! if (verbose) thread->print_on(st); return; } } // Try an OS specific find if (os::find(addr, st)) { return; } ! st->print_cr(INTPTR_FORMAT " is an unknown value", addr); } // Looks like all platforms except IA64 can use the same function to check // if C stack is walkable beyond current frame. The check for fp() is not // necessary on Sparc, but it's harmless.
src/share/vm/runtime/os.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File