-
Enhancement
-
Resolution: Fixed
-
P4
-
25
-
master
There is an nsk/jdi superclass called JDIBase that many tests inherit from. It provides common functionality like log support, basic event handling, support for setting a breakpoint, and support for the communication breakpoint that the debugger and debuggee use to synchronize with. disable001 does not inherit from JDIBase and instead implements all this functionality in the test. The reason is because it provides a slightly modified version of the JDIBase.settingBreakpoint() method. The main change is the presence of the following in settingBreakpoint():
// this is only for this test to get Location object
location = lineLocation;
And then in the test:
case 11:
log2(".....setting up BreakpointRequest");
eventRequest1 = eventRManager.createBreakpointRequest(location);
break;
However, now JDIBase.settingBreakpoint() now contains:
lineLocation = (Location) alllineLocations.get(n);
breakpLocation = lineLocation;
So the test can just use breakpLocation instead. This pattern is already replicated in a large number of tests.
The other difference in the disable001 version of settingBreakpoint() is that is uses SUSPEND_ALL rather than SUSPEND_EVENT_THREAD. This is easily fixed after setting up the breakpoint request:
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
debuggeeClass,
bPointMethod, lineForComm, "zero");
bpRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
The test should remove all this replicated code and use JDIBase instead. It should also be updated to use the new JDIBase.setupBreakpointForCommunication() method.
// this is only for this test to get Location object
location = lineLocation;
And then in the test:
case 11:
log2(".....setting up BreakpointRequest");
eventRequest1 = eventRManager.createBreakpointRequest(location);
break;
However, now JDIBase.settingBreakpoint() now contains:
lineLocation = (Location) alllineLocations.get(n);
breakpLocation = lineLocation;
So the test can just use breakpLocation instead. This pattern is already replicated in a large number of tests.
The other difference in the disable001 version of settingBreakpoint() is that is uses SUSPEND_ALL rather than SUSPEND_EVENT_THREAD. This is easily fixed after setting up the breakpoint request:
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
debuggeeClass,
bPointMethod, lineForComm, "zero");
bpRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
The test should remove all this replicated code and use JDIBase instead. It should also be updated to use the new JDIBase.setupBreakpointForCommunication() method.
- relates to
-
JDK-8355071 Fix nsk/jdi test to not require lookup of main thread in order to set the breakpoint used for communication
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/29f10700
-
Review(master) openjdk/jdk/24811