Fri, 07 Nov 2014 12:48:09 -0800
8062247: [TESTBUG] Allow WhiteBox test to access JVM offsets
Reviewed-by: coleenp, iklam, mseledtsov
Contributed-by: yumin.qi@oracle.com
test/testlibrary/whitebox/sun/hotspot/WhiteBox.java | file | annotate | diff | comparison | revisions |
1.1 --- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java Wed Nov 12 10:34:08 2014 +0000 1.2 +++ b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java Fri Nov 07 12:48:09 2014 -0800 1.3 @@ -208,4 +208,13 @@ 1.4 .findAny() 1.5 .orElse(null); 1.6 } 1.7 + public native int getOffsetForName0(String name); 1.8 + public int getOffsetForName(String name) throws Exception { 1.9 + int offset = getOffsetForName0(name); 1.10 + if (offset == -1) { 1.11 + throw new RuntimeException(name + " not found"); 1.12 + } 1.13 + return offset; 1.14 + } 1.15 + 1.16 }