< prev index next >

src/hotspot/share/utilities/debug.cpp

Print this page

 27 #include "classfile/systemDictionary.hpp"
 28 #include "code/codeCache.hpp"
 29 #include "code/icBuffer.hpp"
 30 #include "code/nmethod.hpp"
 31 #include "code/vtableStubs.hpp"
 32 #include "compiler/compileBroker.hpp"
 33 #include "compiler/disassembler.hpp"
 34 #include "gc/shared/collectedHeap.hpp"
 35 #include "interpreter/interpreter.hpp"
 36 #include "memory/allocation.hpp"
 37 #include "memory/resourceArea.hpp"
 38 #include "memory/universe.hpp"
 39 #include "oops/klass.inline.hpp"
 40 #include "oops/oop.inline.hpp"
 41 #include "runtime/atomic.hpp"
 42 #include "runtime/flags/flagSetting.hpp"
 43 #include "runtime/frame.inline.hpp"
 44 #include "runtime/handles.inline.hpp"
 45 #include "runtime/java.hpp"
 46 #include "runtime/os.hpp"

 47 #include "runtime/sharedRuntime.hpp"
 48 #include "runtime/stubCodeGenerator.hpp"
 49 #include "runtime/stubRoutines.hpp"
 50 #include "runtime/thread.inline.hpp"
 51 #include "runtime/vframe.hpp"
 52 #include "runtime/vm_version.hpp"
 53 #include "services/heapDumper.hpp"
 54 #include "services/memTracker.hpp"
 55 #include "utilities/defaultStream.hpp"
 56 #include "utilities/events.hpp"
 57 #include "utilities/formatBuffer.hpp"
 58 #include "utilities/globalDefinitions.hpp"
 59 #include "utilities/macros.hpp"
 60 #include "utilities/vmError.hpp"
 61 
 62 #include <stdio.h>
 63 #include <stdarg.h>
 64 
 65 // Support for showing register content on asserts/guarantees.
 66 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT

672 // are not having to pass in any arguments, and it will work on Windows/x64.
673 //
674 // WARNING: Only intended for use when debugging. Do not leave calls to
675 // pns2() in committed source (product or debug).
676 //
677 extern "C" JNIEXPORT void pns2() { // print native stack
678   Command c("pns2");
679   static char buf[O_BUFLEN];
680   if (os::platform_print_native_stack(tty, NULL, buf, sizeof(buf))) {
681     // We have printed the native stack in platform-specific code,
682     // so nothing else to do in this case.
683   } else {
684     Thread* t = Thread::current_or_null();
685     frame fr = os::current_frame();
686     VMError::print_native_stack(tty, fr, t, buf, sizeof(buf));
687   }
688 }
689 #endif
690 
691 





692 //////////////////////////////////////////////////////////////////////////////
693 // Test multiple STATIC_ASSERT forms in various scopes.
694 
695 #ifndef PRODUCT
696 
697 // namespace scope
698 STATIC_ASSERT(true);
699 STATIC_ASSERT(true);
700 STATIC_ASSERT(1 == 1);
701 STATIC_ASSERT(0 == 0);
702 
703 void test_multiple_static_assert_forms_in_function_scope() {
704   STATIC_ASSERT(true);
705   STATIC_ASSERT(true);
706   STATIC_ASSERT(0 == 0);
707   STATIC_ASSERT(1 == 1);
708 }
709 
710 // class scope
711 struct TestMultipleStaticAssertFormsInClassScope {

 27 #include "classfile/systemDictionary.hpp"
 28 #include "code/codeCache.hpp"
 29 #include "code/icBuffer.hpp"
 30 #include "code/nmethod.hpp"
 31 #include "code/vtableStubs.hpp"
 32 #include "compiler/compileBroker.hpp"
 33 #include "compiler/disassembler.hpp"
 34 #include "gc/shared/collectedHeap.hpp"
 35 #include "interpreter/interpreter.hpp"
 36 #include "memory/allocation.hpp"
 37 #include "memory/resourceArea.hpp"
 38 #include "memory/universe.hpp"
 39 #include "oops/klass.inline.hpp"
 40 #include "oops/oop.inline.hpp"
 41 #include "runtime/atomic.hpp"
 42 #include "runtime/flags/flagSetting.hpp"
 43 #include "runtime/frame.inline.hpp"
 44 #include "runtime/handles.inline.hpp"
 45 #include "runtime/java.hpp"
 46 #include "runtime/os.hpp"
 47 #include "runtime/safefetch.inline.hpp"
 48 #include "runtime/sharedRuntime.hpp"
 49 #include "runtime/stubCodeGenerator.hpp"
 50 #include "runtime/stubRoutines.hpp"
 51 #include "runtime/thread.inline.hpp"
 52 #include "runtime/vframe.hpp"
 53 #include "runtime/vm_version.hpp"
 54 #include "services/heapDumper.hpp"
 55 #include "services/memTracker.hpp"
 56 #include "utilities/defaultStream.hpp"
 57 #include "utilities/events.hpp"
 58 #include "utilities/formatBuffer.hpp"
 59 #include "utilities/globalDefinitions.hpp"
 60 #include "utilities/macros.hpp"
 61 #include "utilities/vmError.hpp"
 62 
 63 #include <stdio.h>
 64 #include <stdarg.h>
 65 
 66 // Support for showing register content on asserts/guarantees.
 67 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT

673 // are not having to pass in any arguments, and it will work on Windows/x64.
674 //
675 // WARNING: Only intended for use when debugging. Do not leave calls to
676 // pns2() in committed source (product or debug).
677 //
678 extern "C" JNIEXPORT void pns2() { // print native stack
679   Command c("pns2");
680   static char buf[O_BUFLEN];
681   if (os::platform_print_native_stack(tty, NULL, buf, sizeof(buf))) {
682     // We have printed the native stack in platform-specific code,
683     // so nothing else to do in this case.
684   } else {
685     Thread* t = Thread::current_or_null();
686     frame fr = os::current_frame();
687     VMError::print_native_stack(tty, fr, t, buf, sizeof(buf));
688   }
689 }
690 #endif
691 
692 
693 // Returns true iff the address p is readable and *(intptr_t*)p != errvalue
694 extern "C" bool dbg_is_safe(const void* p, intptr_t errvalue) {
695   return p != NULL && SafeFetchN((intptr_t*)const_cast<void*>(p), errvalue) != errvalue;
696 }
697 
698 //////////////////////////////////////////////////////////////////////////////
699 // Test multiple STATIC_ASSERT forms in various scopes.
700 
701 #ifndef PRODUCT
702 
703 // namespace scope
704 STATIC_ASSERT(true);
705 STATIC_ASSERT(true);
706 STATIC_ASSERT(1 == 1);
707 STATIC_ASSERT(0 == 0);
708 
709 void test_multiple_static_assert_forms_in_function_scope() {
710   STATIC_ASSERT(true);
711   STATIC_ASSERT(true);
712   STATIC_ASSERT(0 == 0);
713   STATIC_ASSERT(1 == 1);
714 }
715 
716 // class scope
717 struct TestMultipleStaticAssertFormsInClassScope {
< prev index next >