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