提交 b37653f1 编写于 作者: S sla

8006637: Failure to filter out native frame events on Solaris

Summary: Test is confused by other threads calling String.intern(). Add a thread filter to avoid this.
Reviewed-by: sspitsyn, alanb
上级 72e2012d
...@@ -57,6 +57,7 @@ public class NativeInstanceFilter extends JDIScaffold { ...@@ -57,6 +57,7 @@ public class NativeInstanceFilter extends JDIScaffold {
static EventRequestManager requestManager = null; static EventRequestManager requestManager = null;
static MethodExitRequest request = null; static MethodExitRequest request = null;
static ThreadReference mainThread = null;
private void listen() { private void listen() {
TargetAdapter adapter = new TargetAdapter() { TargetAdapter adapter = new TargetAdapter() {
...@@ -77,6 +78,7 @@ public class NativeInstanceFilter extends JDIScaffold { ...@@ -77,6 +78,7 @@ public class NativeInstanceFilter extends JDIScaffold {
requestManager.deleteEventRequest(request); requestManager.deleteEventRequest(request);
request = requestManager.createMethodExitRequest(); request = requestManager.createMethodExitRequest();
request.addInstanceFilter(instance); request.addInstanceFilter(instance);
request.addThreadFilter(mainThread);
request.enable(); request.enable();
} else if (instance != null && name.equals("intern")) { } else if (instance != null && name.equals("intern")) {
// If not for the filter, this will be called twice // If not for the filter, this will be called twice
...@@ -101,10 +103,12 @@ public class NativeInstanceFilter extends JDIScaffold { ...@@ -101,10 +103,12 @@ public class NativeInstanceFilter extends JDIScaffold {
// VM has started, but hasn't started running the test program yet. // VM has started, but hasn't started running the test program yet.
requestManager = vm().eventRequestManager(); requestManager = vm().eventRequestManager();
ReferenceType referenceType = ClassPrepareEvent e = resumeToPrepareOf("NativeInstanceFilterTarg");
resumeToPrepareOf("NativeInstanceFilterTarg").referenceType(); ReferenceType referenceType = e.referenceType();
mainThread = e.thread();
request = requestManager.createMethodExitRequest(); request = requestManager.createMethodExitRequest();
request.addThreadFilter(mainThread);
request.enable(); request.enable();
listen(); listen();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册