Skip to content

Commit b7e8952

Browse files
committed
8355071: Fix nsk/jdi test to not require lookup of main thread in order to set the breakpoint used for communication
Reviewed-by: lmesnik, amenkov
1 parent cc9148d commit b7e8952

File tree

189 files changed

+462
-1923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+462
-1923
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jdi/BooleanType/_itself_/booleantype001.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -244,14 +244,7 @@ private void testRun()
244244

245245
log2(" received: ClassPrepareEvent for debuggeeClass");
246246

247-
String bPointMethod = "methodForCommunication";
248-
String lineForComm = "lineForComm";
249-
BreakpointRequest bpRequest;
250-
251-
bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
252-
debuggeeClass,
253-
bPointMethod, lineForComm, "zero");
254-
bpRequest.enable();
247+
setupBreakpointForCommunication(debuggeeClass);
255248

256249
//------------------------------------------------------ testing section
257250

test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -257,15 +257,7 @@ private void testRun()
257257

258258
log2(" received: ClassPrepareEvent for debuggeeClass");
259259

260-
String bPointMethod = "methodForCommunication";
261-
String lineForComm = "lineForComm";
262-
263-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
264-
265-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
266-
debuggeeClass,
267-
bPointMethod, lineForComm, "zero");
268-
bpRequest.enable();
260+
setupBreakpointForCommunication(debuggeeClass);
269261

270262
//------------------------------------------------------ testing section
271263

test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -245,15 +245,7 @@ private void testRun()
245245

246246
log2(" received: ClassPrepareEvent for debuggeeClass");
247247

248-
String bPointMethod = "methodForCommunication";
249-
String lineForComm = "lineForComm";
250-
251-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
252-
253-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
254-
debuggeeClass,
255-
bPointMethod, lineForComm, "zero");
256-
bpRequest.enable();
248+
setupBreakpointForCommunication(debuggeeClass);
257249

258250
//------------------------------------------------------ testing section
259251

test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -252,15 +252,7 @@ private void testRun()
252252

253253
log2(" received: ClassPrepareEvent for debuggeeClass");
254254

255-
String bPointMethod = "methodForCommunication";
256-
String lineForComm = "lineForComm";
257-
258-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
259-
260-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
261-
debuggeeClass,
262-
bPointMethod, lineForComm, "zero");
263-
bpRequest.enable();
255+
setupBreakpointForCommunication(debuggeeClass);
264256

265257
//------------------------------------------------------ testing section
266258

test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -252,15 +252,7 @@ private void testRun()
252252

253253
log2(" received: ClassPrepareEvent for debuggeeClass");
254254

255-
String bPointMethod = "methodForCommunication";
256-
String lineForComm = "lineForComm";
257-
258-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
259-
260-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
261-
debuggeeClass,
262-
bPointMethod, lineForComm, "zero");
263-
bpRequest.enable();
255+
setupBreakpointForCommunication(debuggeeClass);
264256

265257
//------------------------------------------------------ testing section
266258

test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -250,16 +250,7 @@ private void testRun()
250250

251251
log2(" received: ClassPrepareEvent for debuggeeClass");
252252

253-
String bPointMethod = "methodForCommunication";
254-
String lineForComm = "lineForComm";
255-
256-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
257-
258-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
259-
260-
debuggeeClass,
261-
bPointMethod, lineForComm, "zero");
262-
bpRequest.enable();
253+
setupBreakpointForCommunication(debuggeeClass);
263254

264255
//------------------------------------------------------ testing section
265256

test/hotspot/jtreg/vmTestbase/nsk/jdi/ByteType/_itself_/bytetype001.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -238,14 +238,7 @@ private void testRun()
238238

239239
log2(" received: ClassPrepareEvent for debuggeeClass");
240240

241-
String bPointMethod = "methodForCommunication";
242-
String lineForComm = "lineForComm";
243-
BreakpointRequest bpRequest;
244-
245-
bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
246-
debuggeeClass,
247-
bPointMethod, lineForComm, "zero");
248-
bpRequest.enable();
241+
setupBreakpointForCommunication(debuggeeClass);
249242

250243
//------------------------------------------------------ testing section
251244

test/hotspot/jtreg/vmTestbase/nsk/jdi/CharType/_itself_/chartype001.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -238,14 +238,7 @@ private void testRun()
238238

239239
log2(" received: ClassPrepareEvent for debuggeeClass");
240240

241-
String bPointMethod = "methodForCommunication";
242-
String lineForComm = "lineForComm";
243-
BreakpointRequest bpRequest;
244-
245-
bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
246-
debuggeeClass,
247-
bPointMethod, lineForComm, "zero");
248-
bpRequest.enable();
241+
setupBreakpointForCommunication(debuggeeClass);
249242

250243
//------------------------------------------------------ testing section
251244

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses001.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -241,14 +241,7 @@ private void testRun()
241241

242242
log2(" received: ClassPrepareEvent for debuggeeClass");
243243

244-
String bPointMethod = "methodForCommunication";
245-
String lineForComm = "lineForComm";
246-
BreakpointRequest bpRequest;
247-
248-
bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
249-
debuggeeClass,
250-
bPointMethod, lineForComm, "zero");
251-
bpRequest.enable();
244+
setupBreakpointForCommunication(debuggeeClass);
252245

253246
//------------------------------------------------------ testing section
254247

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses001.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -255,14 +255,7 @@ private void testRun()
255255

256256
log2(" received: ClassPrepareEvent for debuggeeClass");
257257

258-
String bPointMethod = "methodForCommunication";
259-
String lineForComm = "lineForComm";
260-
BreakpointRequest bpRequest;
261-
262-
bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
263-
debuggeeClass,
264-
bPointMethod, lineForComm, "zero");
265-
bpRequest.enable();
258+
setupBreakpointForCommunication(debuggeeClass);
266259

267260
//------------------------------------------------------ testing section
268261

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter003.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -244,18 +244,9 @@ private void testRun()
244244

245245
log2(" received: ClassPrepareEvent for debuggeeClass");
246246

247-
String bPointMethod = "methodForCommunication";
248-
String lineForComm = "lineForComm";
247+
setupBreakpointForCommunication(debuggeeClass);
249248

250-
251-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
252-
253-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
254-
debuggeeClass,
255-
bPointMethod, lineForComm, "zero");
256-
bpRequest.enable();
257-
258-
//------------------------------------------------------ testing section
249+
//------------------------------------------------------ testing section
259250

260251
log1(" TESTING BEGINS");
261252

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -248,15 +248,7 @@ private void testRun()
248248

249249
log2(" received: ClassPrepareEvent for debuggeeClass");
250250

251-
String bPointMethod = "methodForCommunication";
252-
String lineForComm = "lineForComm";
253-
254-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
255-
256-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
257-
debuggeeClass,
258-
bPointMethod, lineForComm, "zero");
259-
bpRequest.enable();
251+
setupBreakpointForCommunication(debuggeeClass);
260252

261253
//------------------------------------------------------ testing section
262254

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -250,16 +250,7 @@ private void testRun()
250250

251251
log2(" received: ClassPrepareEvent for debuggeeClass");
252252

253-
String bPointMethod = "methodForCommunication";
254-
String lineForComm = "lineForComm";
255-
256-
257-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
258-
259-
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
260-
debuggeeClass,
261-
bPointMethod, lineForComm, "zero");
262-
bpRequest.enable();
253+
setupBreakpointForCommunication(debuggeeClass);
263254

264255
//------------------------------------------------------ testing section
265256

test/hotspot/jtreg/vmTestbase/nsk/jdi/DoubleType/_itself_/doubletype001.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -238,14 +238,7 @@ private void testRun()
238238

239239
log2(" received: ClassPrepareEvent for debuggeeClass");
240240

241-
String bPointMethod = "methodForCommunication";
242-
String lineForComm = "lineForComm";
243-
BreakpointRequest bpRequest;
244-
245-
bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
246-
debuggeeClass,
247-
bPointMethod, lineForComm, "zero");
248-
bpRequest.enable();
241+
setupBreakpointForCommunication(debuggeeClass);
249242

250243
//------------------------------------------------------ testing section
251244

test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -308,16 +308,7 @@ private void testRun()
308308

309309
log2("......setting up ClassPrepareEvent");
310310

311-
String bPointMethod = "methodForCommunication";
312-
String lineForComm = "lineForComm";
313-
BreakpointRequest bpRequest;
314-
315-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
316-
317-
bpRequest = settingBreakpoint(mainThread,
318-
debuggeeClass,
319-
bPointMethod, lineForComm, "zero");
320-
bpRequest.enable();
311+
setupBreakpointForCommunication(debuggeeClass);
321312

322313
//------------------------------------------------------ testing section
323314

test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -306,16 +306,7 @@ private void testRun()
306306

307307
log2("......setting up ClassPrepareEvent");
308308

309-
String bPointMethod = "methodForCommunication";
310-
String lineForComm = "lineForComm";
311-
BreakpointRequest bpRequest;
312-
313-
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
314-
315-
bpRequest = settingBreakpoint(mainThread,
316-
debuggeeClass,
317-
bPointMethod, lineForComm, "zero");
318-
bpRequest.enable();
309+
setupBreakpointForCommunication(debuggeeClass);
319310

320311
//------------------------------------------------------ testing section
321312

0 commit comments

Comments
 (0)