< 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

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





690 //////////////////////////////////////////////////////////////////////////////
691 // Test multiple STATIC_ASSERT forms in various scopes.
692 
693 #ifndef PRODUCT
694 
695 // namespace scope
696 STATIC_ASSERT(true);
697 STATIC_ASSERT(true);
698 STATIC_ASSERT(1 == 1);
699 STATIC_ASSERT(0 == 0);
700 
701 void test_multiple_static_assert_forms_in_function_scope() {
702   STATIC_ASSERT(true);
703   STATIC_ASSERT(true);
704   STATIC_ASSERT(0 == 0);
705   STATIC_ASSERT(1 == 1);
706 }
707 
708 // class scope
709 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

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