< prev index next >

src/hotspot/share/utilities/debug.cpp

Print this page
*** 42,10 ***
--- 42,11 ---
  #include "runtime/flags/flagSetting.hpp"
  #include "runtime/frame.inline.hpp"
  #include "runtime/handles.inline.hpp"
  #include "runtime/java.hpp"
  #include "runtime/os.hpp"
+ #include "runtime/safefetch.inline.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "runtime/stubCodeGenerator.hpp"
  #include "runtime/stubRoutines.hpp"
  #include "runtime/thread.inline.hpp"
  #include "runtime/vframe.hpp"

*** 687,10 ***
--- 688,15 ---
    }
  }
  #endif
  
  
+ // Returns true iff the address p is readable and *(intptr_t*)p != errvalue
+ extern "C" bool dbg_is_safe(const void* p, intptr_t errvalue) {
+   return p != NULL && SafeFetchN((intptr_t*)const_cast<void*>(p), errvalue) != errvalue;
+ }
+ 
  //////////////////////////////////////////////////////////////////////////////
  // Test multiple STATIC_ASSERT forms in various scopes.
  
  #ifndef PRODUCT
  
< prev index next >