Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -108,8 +108,7 @@ private int runThis (String argv[], PrintStream out) {
logHandler = new Log(out, argsHandler);
Binder binder = new Binder(argsHandler, logHandler);

debugee = Debugee.prepareDebugee(argsHandler, logHandler,
debugeeName + (argsHandler.verbose() ? " -vbs" : ""));
debugee = Debugee.prepareDebugee(argsHandler, logHandler, debugeeName);

// ReferenceType classes[] = debugee.classes();
// for (int i=0; i<classes.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -118,7 +118,7 @@ private static void execTest() {
switch (i) {

case 0:
ThreadReference thread = debuggee.threadByNameOrThrow(methodName);
ThreadReference thread = debuggee.mainThread();

display(".....setting up StepRequest");
eventRequest = eventRequestManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -95,7 +95,7 @@ private void execTest() {

EventRequest request;
EventRequestManager evm = debugee.getEventRequestManager();
ThreadReference thread = debugee.threadByName("main");
ThreadReference thread = debugee.mainThread();

display("");
display("...calling createStepRequest(null, StepRequest.STEP_LINE, "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,15 @@ private void testRun()

ClassPrepareEvent event = (ClassPrepareEvent) eventIterator.next();
debuggeeClass = event.referenceType();
debuggee.setMainThread(event.thread());

if (!debuggeeClass.name().equals(debuggeeName))
throw new JDITestRuntimeException("** Unexpected ClassName for ClassPrepareEvent **");
log2(" received: ClassPrepareEvent for debuggeeClass");

log2("......setting up ClassPrepareEvent for breakpointForCommunication");

ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
ThreadReference mainThread = debuggee.mainThread();
setupBreakpointForCommunication(debuggeeClass);

//------------------------------------------------------ testing section
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -139,7 +139,7 @@ public static int run(String argv[], PrintStream out) {

private static void execTest() {

ThreadReference mainThread = debuggee.threadByName("main");
ThreadReference mainThread = debuggee.mainThread();

// Set first breakpoint to have isobsolete003b class loaded.
BreakpointRequest bpRequest = debuggee.makeBreakpoint(debuggeeClass, "main", brkpMainLineNumber);
Expand Down Expand Up @@ -456,6 +456,7 @@ private static void waitForDebuggeeClassPrepared () {
ClassPrepareEvent event = (ClassPrepareEvent) waitForEvent(cpRequest);
cpRequest.disable();

debuggee.setMainThread(event.thread());
debuggeeClass = event.referenceType();
if (!debuggeeClass.name().equals(debuggeeName))
throw new Failure("Unexpected class name for ClassPrepareEvent : " + debuggeeClass.name());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -113,6 +113,9 @@ public static int run(final String args[], final PrintStream out) {

pipe = debuggee.createIOPipe();

ClassPrepareEvent cpEvent = debuggee.waitForClassPrepare(DEBUGGEE_NAME);
debuggee.setMainThread(cpEvent.thread());

// resume debuggee
log.display("Resuming debuggee");
debuggee.resume();
Expand All @@ -135,7 +138,7 @@ public static int run(final String args[], final PrintStream out) {
checkedClass = debuggee.classByName(CHILD_NAME);

log.display("Getting <main> thread in debuggee");
checkedThread = debuggee.threadByName("main");
checkedThread = debuggee.mainThread();
if (checkedThread == null) {
throw new Failure("TEST BUG: unable to find reference to main thread");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -110,6 +110,9 @@ public static int run(final String args[], final PrintStream out) {

pipe = debuggee.createIOPipe();

ClassPrepareEvent cpEvent = debuggee.waitForClassPrepare(DEBUGGEE_NAME);
debuggee.setMainThread(cpEvent.thread());

// resume debuggee
log.display("Resuming debuggee");
debuggee.resume();
Expand All @@ -131,7 +134,7 @@ public static int run(final String args[], final PrintStream out) {
checkedClass = debuggee.classByName(DEBUGGEE_NAME);

log.display("Getting reference to thread <main>");
checkedThread = debuggee.threadByName("main");
checkedThread = debuggee.mainThread();
if (checkedThread == null) {
throw new Failure("TEST BUG: unable to find reference to main thread");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -114,6 +114,9 @@ public static int run(final String args[], final PrintStream out) {

pipe = debuggee.createIOPipe();

ClassPrepareEvent cpEvent = debuggee.waitForClassPrepare(DEBUGGEE_NAME);
debuggee.setMainThread(cpEvent.thread());

// resume debuggee
log.display("Resuming debuggee");
debuggee.resume();
Expand All @@ -136,7 +139,7 @@ public static int run(final String args[], final PrintStream out) {
checkedClass = debuggee.classByName(CHILD_NAME);

log.display("Getting reference to thread <main>");
checkedThread = debuggee.threadByName("main");
checkedThread = debuggee.mainThread();
if (checkedThread == null) {
throw new Failure("TEST BUG: unable to find reference to main thread");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -153,7 +153,7 @@ private int runThis(String argv[], PrintStream out) {
//--------------------------------------------------------- mutable common methods

private void execTest() {
ThreadReference mainThread = debuggee.threadByName("main");
ThreadReference mainThread = debuggee.mainThread();

BreakpointRequest bpRequest = debuggee.makeBreakpoint(debuggeeClass,
"methodForCommunication",
Expand Down Expand Up @@ -290,6 +290,8 @@ private ReferenceType waitForDebuggeeClassPrepared () {
ClassPrepareEvent event = (ClassPrepareEvent) waitForEvent(cpRequest);
cpRequest.disable();

debuggee.setMainThread(event.thread()); // Needed so debuggee.mainThread() will work

if (!event.referenceType().name().equals(debuggeeName)) {
throw new Failure("Unexpected class name for ClassPrepareEvent : " + debuggeeClass.name());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -153,7 +153,7 @@ private int runThis(String argv[], PrintStream out) {
//--------------------------------------------------------- mutable common methods

private void execTest() {
ThreadReference mainThread = debuggee.threadByName("main");
ThreadReference mainThread = debuggee.mainThread();

BreakpointRequest bpRequest = debuggee.makeBreakpoint(debuggeeClass,
"methodForCommunication",
Expand Down Expand Up @@ -298,6 +298,8 @@ private ReferenceType waitForDebuggeeClassPrepared () {
ClassPrepareEvent event = (ClassPrepareEvent) waitForEvent(cpRequest);
cpRequest.disable();

debuggee.setMainThread(event.thread()); // Needed so debuggee.mainThread() will work

if (!event.referenceType().name().equals(debuggeeName)) {
throw new Failure("Unexpected class name for ClassPrepareEvent : " + debuggeeClass.name());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -95,7 +95,7 @@ public static int run(String argv[], PrintStream out) {
private void execTest() {

debugee.VM().suspend();
ThreadReference thread = debugee.threadByName("main");
ThreadReference thread = debugee.mainThread();
StackFrame stackFrame = null;
boolean isTopmostFrame = false;
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -87,7 +87,7 @@ private void execTest() {
display("");
display(">>>creating StepRequest");

ThreadReference thread = debugee.threadByName("main");
ThreadReference thread = debugee.mainThread();
EventRequestManager evm = debugee.getEventRequestManager();
StepRequest request = evm.createStepRequest(thread, StepRequest.STEP_LINE,
StepRequest.STEP_INTO);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -97,7 +97,7 @@ public static int run(String argv[], PrintStream out) {
private void execTest() {

debugee.VM().suspend();
ThreadReference thread = debugee.threadByName("main");
ThreadReference thread = debugee.mainThread();

display("\nTEST BEGINS");
display("===========");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -158,7 +158,7 @@ private void execTest() throws TestBug {
display("\nTEST BEGINS");
display("===========");

ThreadReference thrd = debugee.threadByName("main");
ThreadReference thrd = debugee.mainThread();
if (thrd.isSuspended()) {
display("\n\n<<<Debugee is suspended>>>");
display("--------------------------");
Expand All @@ -167,7 +167,6 @@ private void execTest() throws TestBug {

debugee.resume();

thrd = debugee.threadByName("main");
if (!thrd.isSuspended()) {
display("\n\n<<<Debugee is not suspended>>>");
display("------------------------------");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -155,7 +155,7 @@ private void execTest() throws TestBug {
display("\nTEST BEGINS");
display("===========");

ThreadReference thrd = debugee.threadByName("main");
ThreadReference thrd = debugee.mainThread();
if (thrd.isSuspended()) {
statDebugee = "Debugee is suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand All @@ -165,7 +165,6 @@ private void execTest() throws TestBug {

debugee.resume();

thrd = debugee.threadByName("main");
if (!thrd.isSuspended()) {
statDebugee = "Debugee is not suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -157,7 +157,7 @@ private void execTest() throws TestBug {
display("\nTEST BEGINS");
display("===========");

ThreadReference thrd = debugee.threadByName("main");
ThreadReference thrd = debugee.mainThread();
if (thrd.isSuspended()) {
statDebugee = "Debugee is suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand All @@ -167,7 +167,6 @@ private void execTest() throws TestBug {

debugee.resume();

thrd = debugee.threadByName("main");
if (!thrd.isSuspended()) {
statDebugee = "Debugee is not suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -164,7 +164,7 @@ private void execTest() throws TestBug {
display("\nTEST BEGINS");
display("===========");

ThreadReference thrd = debugee.threadByName("main");
ThreadReference thrd = debugee.mainThread();
if (thrd.isSuspended()) {
statDebugee = "Debugee is suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand All @@ -174,7 +174,6 @@ private void execTest() throws TestBug {

debugee.resume();

thrd = debugee.threadByName("main");
if (!thrd.isSuspended()) {
statDebugee = "Debugee is not suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -162,7 +162,7 @@ private void execTest() throws TestBug {
display("\nTEST BEGINS");
display("===========");

ThreadReference thrd = debugee.threadByName("main");
ThreadReference thrd = debugee.mainThread();
if (thrd.isSuspended()) {
statDebugee = "Debugee is suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand All @@ -172,7 +172,6 @@ private void execTest() throws TestBug {

debugee.resume();

thrd = debugee.threadByName("main");
if (!thrd.isSuspended()) {
statDebugee = "Debugee is not suspended";
display("\n\n<<<" + statDebugee + ">>>");
Expand Down
Loading