Skip to content

Commit b42d02b

Browse files
author
duke
committed
Backport 14e41ab055955ffd7cf9e8129cc3269b4e3807b7
1 parent b17a237 commit b42d02b

File tree

22 files changed

+316
-370
lines changed

22 files changed

+316
-370
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod009.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ private int runIt(String args[], PrintStream out) {
112112
return quitDebuggee();
113113
}
114114

115-
// debuggee main class
116-
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
117-
118-
thrRef = debuggee.threadByFieldName(rType, "testThread", DEBUGGEE_THRNAME);
119-
if (thrRef == null) {
120-
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
121-
+ DEBUGGEE_THRNAME);
122-
tot_res = Consts.TEST_FAILED;
123-
return quitDebuggee();
124-
}
115+
try {
116+
// debuggee main class
117+
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
118+
119+
thrRef = debuggee.threadByFieldName(rType, "testThread", DEBUGGEE_THRNAME);
120+
if (thrRef == null) {
121+
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
122+
+ DEBUGGEE_THRNAME);
123+
tot_res = Consts.TEST_FAILED;
124+
return quitDebuggee();
125+
}
125126

126127
// Check the tested assersion
127-
try {
128128
suspendAtBP(rType, DEBUGGEE_STOPATLINE);
129129
ClassType clsType = (ClassType) rType;
130130

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod010.java

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,36 +111,29 @@ private int runIt(String args[], PrintStream out) {
111111
return quitDebuggee();
112112
}
113113

114-
// debuggee main class
115-
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
114+
try {
115+
// debuggee main class
116+
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
116117

117-
thrRef = debuggee.threadByFieldName(rType, "testThread", DEBUGGEE_THRNAME);
118-
if (thrRef == null) {
119-
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
120-
+ DEBUGGEE_THRNAME);
121-
tot_res = Consts.TEST_FAILED;
122-
return quitDebuggee();
123-
}
124-
thrRef.suspend();
125-
while(!thrRef.isSuspended()) {
126-
num++;
127-
if (num > ATTEMPTS) {
128-
log.complain("TEST FAILED: unable to suspend debuggee thread");
118+
thrRef = debuggee.threadByFieldName(rType, "testThread", DEBUGGEE_THRNAME);
119+
if (thrRef == null) {
120+
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
121+
+ DEBUGGEE_THRNAME);
129122
tot_res = Consts.TEST_FAILED;
130123
return quitDebuggee();
131124
}
132-
log.display("Waiting for debuggee thread suspension ...");
133-
try {
125+
thrRef.suspend();
126+
while(!thrRef.isSuspended()) {
127+
num++;
128+
if (num > ATTEMPTS) {
129+
log.complain("TEST FAILED: unable to suspend debuggee thread");
130+
tot_res = Consts.TEST_FAILED;
131+
return quitDebuggee();
132+
}
133+
log.display("Waiting for debuggee thread suspension ...");
134134
Thread.currentThread().sleep(TIMEOUT_DELTA);
135-
} catch(InterruptedException ie) {
136-
ie.printStackTrace();
137-
log.complain("TEST FAILED: caught: " + ie);
138-
tot_res = Consts.TEST_FAILED;
139-
return quitDebuggee();
140135
}
141-
}
142136

143-
try {
144137
// debuggee main class
145138
ClassType clsType = (ClassType) rType;
146139

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod014.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,20 @@ private int runIt(String args[], PrintStream out) {
113113
return quitDebuggee();
114114
}
115115

116-
// debuggee main class
117-
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
118-
ClassType clsType = (ClassType) rType;
119-
120-
ThreadReference thrRef =
121-
debuggee.threadByFieldName(rType, "testThread", DEBUGGEE_THRNAME);
122-
if (thrRef == null) {
123-
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
124-
+ DEBUGGEE_THRNAME);
125-
tot_res = Consts.TEST_FAILED;
126-
return quitDebuggee();
127-
}
128-
129116
try {
117+
// debuggee main class
118+
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
119+
ClassType clsType = (ClassType) rType;
120+
121+
ThreadReference thrRef =
122+
debuggee.threadByFieldName(rType, "testThread", DEBUGGEE_THRNAME);
123+
if (thrRef == null) {
124+
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
125+
+ DEBUGGEE_THRNAME);
126+
tot_res = Consts.TEST_FAILED;
127+
return quitDebuggee();
128+
}
129+
130130
suspendAtBP(rType, DEBUGGEE_STOPATLINE);
131131

132132
for (int i=0; i<METH_NUM; i++) {

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance009.java

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,37 +95,30 @@ private int runIt(String args[], PrintStream out) {
9595
return quitDebuggee();
9696
}
9797

98-
// debuggee main class
99-
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
100-
ClassType clsType = (ClassType) rType;
101-
102-
ThreadReference thrRef = debuggee.threadByFieldName(rType, "thread", DEBUGGEE_THRNAME);
103-
if (thrRef == null) {
104-
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
105-
+ DEBUGGEE_THRNAME);
106-
tot_res = Consts.TEST_FAILED;
107-
return quitDebuggee();
108-
}
109-
thrRef.suspend();
110-
while(!thrRef.isSuspended()) {
111-
num++;
112-
if (num > ATTEMPTS) {
113-
log.complain("TEST FAILED: unable to suspend debuggee thread");
98+
try {
99+
// debuggee main class
100+
ReferenceType rType = debuggee.classByName(DEBUGGEE_CLASS);
101+
ClassType clsType = (ClassType) rType;
102+
103+
ThreadReference thrRef = debuggee.threadByFieldName(rType, "thread", DEBUGGEE_THRNAME);
104+
if (thrRef == null) {
105+
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
106+
+ DEBUGGEE_THRNAME);
114107
tot_res = Consts.TEST_FAILED;
115108
return quitDebuggee();
116109
}
117-
log.display("Waiting for debuggee thread suspension ...");
118-
try {
110+
thrRef.suspend();
111+
while(!thrRef.isSuspended()) {
112+
num++;
113+
if (num > ATTEMPTS) {
114+
log.complain("TEST FAILED: unable to suspend debuggee thread");
115+
tot_res = Consts.TEST_FAILED;
116+
return quitDebuggee();
117+
}
118+
log.display("Waiting for debuggee thread suspension ...");
119119
Thread.currentThread().sleep(DELAY);
120-
} catch(InterruptedException ie) {
121-
ie.printStackTrace();
122-
log.complain("TEST FAILED: caught: " + ie);
123-
tot_res = Consts.TEST_FAILED;
124-
return quitDebuggee();
125120
}
126-
}
127121

128-
try {
129122
List methList = rType.methodsByName("<init>");
130123
if (methList.isEmpty()) {
131124
log.complain("TEST FAILURE: the expected constructor "

test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod002.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,18 @@ private int runIt(String args[], PrintStream out) {
124124
return quitDebuggee();
125125
}
126126

127-
rType[0] = debuggee.classByName(DEBUGGEE_CLASS); // debuggee main class
127+
try {
128+
rType[0] = debuggee.classByName(DEBUGGEE_CLASS); // debuggee main class
128129

129-
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
130-
if (thrRef == null) {
131-
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
132-
+ DEBUGGEE_THRNAME);
133-
tot_res = Consts.TEST_FAILED;
134-
return quitDebuggee();
135-
}
130+
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
131+
if (thrRef == null) {
132+
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
133+
+ DEBUGGEE_THRNAME);
134+
tot_res = Consts.TEST_FAILED;
135+
return quitDebuggee();
136+
}
136137

137138
// Check the tested assersion
138-
try {
139139
suspendAtBP(rType[0], DEBUGGEE_STOPATLINE);
140140
findObjRef(DEBUGGEE_LOCALVAR);
141141
rType[1] = objRef[1].referenceType(); // debuggee dummy class

test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod003.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,24 @@ private int runIt(String args[], PrintStream out) {
135135
return quitDebuggee();
136136
}
137137

138-
ReferenceType[] rType = new ReferenceType[3];
139-
// debuggee main class
140-
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
141-
// debuggee dummy interface
142-
rType[1] = debuggee.classByName(DEBUGGEE_INTERFACE);
143-
// debuggee dummy abstract class
144-
rType[2] = debuggee.classByName(DEBUGGEE_ABSTRACTCLASS);
145-
146-
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
147-
if (thrRef == null) {
148-
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
149-
+ DEBUGGEE_THRNAME);
150-
tot_res = Consts.TEST_FAILED;
151-
return quitDebuggee();
152-
}
138+
try {
139+
ReferenceType[] rType = new ReferenceType[3];
140+
// debuggee main class
141+
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
142+
// debuggee dummy interface
143+
rType[1] = debuggee.classByName(DEBUGGEE_INTERFACE);
144+
// debuggee dummy abstract class
145+
rType[2] = debuggee.classByName(DEBUGGEE_ABSTRACTCLASS);
146+
147+
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
148+
if (thrRef == null) {
149+
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
150+
+ DEBUGGEE_THRNAME);
151+
tot_res = Consts.TEST_FAILED;
152+
return quitDebuggee();
153+
}
153154

154155
// Check the tested assersion
155-
try {
156156
suspendAtBP(rType[0], DEBUGGEE_STOPATLINE);
157157
ObjectReference objRef = findObjRef(DEBUGGEE_LOCALVAR);
158158

test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod004.java

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -111,36 +111,29 @@ private int runIt(String args[], PrintStream out) {
111111
return quitDebuggee();
112112
}
113113

114-
ReferenceType debuggeeClass = debuggee.classByName(DEBUGGEE_CLASS); // debuggee main class
114+
try {
115+
ReferenceType debuggeeClass = debuggee.classByName(DEBUGGEE_CLASS); // debuggee main class
115116

116-
thrRef = debuggee.threadByFieldName(debuggeeClass, "testThread", DEBUGGEE_THRNAME);
117-
if (thrRef == null) {
118-
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
119-
+ DEBUGGEE_THRNAME);
120-
tot_res = Consts.TEST_FAILED;
121-
return quitDebuggee();
122-
}
123-
thrRef.suspend();
124-
while(!thrRef.isSuspended()) {
125-
num++;
126-
if (num > ATTEMPTS) {
127-
log.complain("TEST FAILED: unable to suspend debuggee thread");
117+
thrRef = debuggee.threadByFieldName(debuggeeClass, "testThread", DEBUGGEE_THRNAME);
118+
if (thrRef == null) {
119+
log.complain("TEST FAILURE: method Debugee.threadByFieldName() returned null for debuggee thread "
120+
+ DEBUGGEE_THRNAME);
128121
tot_res = Consts.TEST_FAILED;
129122
return quitDebuggee();
130123
}
131-
log.display("Waiting for debuggee thread suspension ...");
132-
try {
124+
thrRef.suspend();
125+
while(!thrRef.isSuspended()) {
126+
num++;
127+
if (num > ATTEMPTS) {
128+
log.complain("TEST FAILED: unable to suspend debuggee thread");
129+
tot_res = Consts.TEST_FAILED;
130+
return quitDebuggee();
131+
}
132+
log.display("Waiting for debuggee thread suspension ...");
133133
Thread.currentThread().sleep(1000);
134-
} catch(InterruptedException ie) {
135-
ie.printStackTrace();
136-
log.complain("TEST FAILED: caught: " + ie);
137-
tot_res = Consts.TEST_FAILED;
138-
return quitDebuggee();
139134
}
140-
}
141135

142136
// Check the tested assersion
143-
try {
144137
ObjectReference objRef = findObjRef(DEBUGGEE_LOCALVAR);
145138
ReferenceType rType = objRef.referenceType(); // debuggee dummy class
146139

test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod005.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,20 @@ private int runIt(String args[], PrintStream out) {
113113
return quitDebuggee();
114114
}
115115

116-
ReferenceType[] rType = new ReferenceType[2];
117-
// debuggee main class
118-
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
119-
120-
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
121-
if (thrRef == null) {
122-
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
123-
+ DEBUGGEE_THRNAME);
124-
tot_res = Consts.TEST_FAILED;
125-
return quitDebuggee();
126-
}
116+
try {
117+
ReferenceType[] rType = new ReferenceType[2];
118+
// debuggee main class
119+
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
120+
121+
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
122+
if (thrRef == null) {
123+
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
124+
+ DEBUGGEE_THRNAME);
125+
tot_res = Consts.TEST_FAILED;
126+
return quitDebuggee();
127+
}
127128

128129
// Check the tested assersion
129-
try {
130130
suspendAtBP(rType[0], DEBUGGEE_STOPATLINE);
131131
ObjectReference objRef = findObjRef(DEBUGGEE_LOCALVAR);
132132
rType[1] = objRef.referenceType(); // debuggee dummy class

test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod006.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,20 @@ private int runIt(String args[], PrintStream out) {
111111
return quitDebuggee();
112112
}
113113

114-
ReferenceType[] rType = new ReferenceType[2];
115-
// debuggee main class
116-
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
117-
118-
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
119-
if (thrRef == null) {
120-
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
121-
+ DEBUGGEE_THRNAME);
122-
tot_res = Consts.TEST_FAILED;
123-
return quitDebuggee();
124-
}
114+
try {
115+
ReferenceType[] rType = new ReferenceType[2];
116+
// debuggee main class
117+
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
118+
119+
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
120+
if (thrRef == null) {
121+
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
122+
+ DEBUGGEE_THRNAME);
123+
tot_res = Consts.TEST_FAILED;
124+
return quitDebuggee();
125+
}
125126

126127
// Check the tested assersion
127-
try {
128128
suspendAtBP(rType[0], DEBUGGEE_STOPATLINE);
129129
ObjectReference objRef = findObjRef(DEBUGGEE_LOCALVAR);
130130
rType[1] = objRef.referenceType(); // debuggee dummy class

test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod007.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,20 @@ private int runIt(String args[], PrintStream out) {
127127
return quitDebuggee();
128128
}
129129

130-
ReferenceType[] rType = new ReferenceType[2];
131-
// debuggee main class
132-
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
133-
134-
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
135-
if (thrRef == null) {
136-
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
137-
+ DEBUGGEE_THRNAME);
138-
tot_res = Consts.TEST_FAILED;
139-
return quitDebuggee();
140-
}
130+
try {
131+
ReferenceType[] rType = new ReferenceType[2];
132+
// debuggee main class
133+
rType[0] = debuggee.classByName(DEBUGGEE_CLASS);
134+
135+
thrRef = debuggee.threadByFieldName(rType[0], "testThread", DEBUGGEE_THRNAME);
136+
if (thrRef == null) {
137+
log.complain("TEST FAILURE: Method Debugee.threadByFieldName() returned null for debuggee thread "
138+
+ DEBUGGEE_THRNAME);
139+
tot_res = Consts.TEST_FAILED;
140+
return quitDebuggee();
141+
}
141142

142143
// Check the tested assersion
143-
try {
144144
suspendAtBP(rType[0], DEBUGGEE_STOPATLINE);
145145
ObjectReference objRef = findObjRef(DEBUGGEE_LOCALVAR);
146146
rType[1] = objRef.referenceType(); // debuggee dummy class

0 commit comments

Comments
 (0)