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
Expand Up @@ -291,7 +291,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);

thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);
log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
(thread1, StepRequest.STEP_MIN, StepRequest.STEP_INTO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest");
eventRequest1 = eventRManager.createStepRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private void testRun()

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ variable part

thread = debuggee.threadByNameOrThrow(threadName);
thread = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName);

if (StepRequest.STEP_MIN > StepRequest.STEP_LINE) {
maxSize = StepRequest.STEP_MIN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public static void main (String argv[]) {

//------------------------------------------------------ test specific fields

static final int lineForBreakInThread = 137;
static final int[] checkedLines = { 138, 138, 178 };
static final int lineForBreakInThread = 141;
static final int[] checkedLines = { 142, 142, 182 };
Comment on lines +80 to +81
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the added lines in the debuggee below.


//------------------------------------------------------ mutable common methods

Expand Down Expand Up @@ -247,7 +247,7 @@ private void setAndCheckStepEvent ( BreakpointRequest bpRequest,
exitCode = FAILED;
}

ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
ThreadReference thread = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName);
StepRequest stepRequest = setStepRequest( thread,
StepRequest.STEP_LINE,
stepDepth,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, 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 @@ -55,6 +55,10 @@ public class crstepreq003a {

static Object waitnotifyObj = new Object();

static Thread thread0;
static Thread thread1;
static Thread thread2;

//------------------------------------------------------ mutable common method

public static void main (String argv[]) {
Expand All @@ -72,21 +76,21 @@ public static void main (String argv[]) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test case section
case 0:

Thread thread0 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread0"));
thread0 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread0"));
threadStart(thread0);
threadJoin (thread0, "0");
break;

case 1:

Thread thread1 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread1"));
thread1 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread1"));
threadStart(thread1);
threadJoin (thread1, "1");
break;

case 2:

Thread thread2 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread2"));
thread2 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread2"));
threadStart(thread2);
threadJoin (thread2, "2");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public static void main (String argv[]) {

//------------------------------------------------------ test specific fields

static final int lineForBreakInThread = 146;
static final int[] checkedLines = { 160, 160, 193 };
static final int[] checkedLinesAlt = { 161, 161, 193 };
static final int lineForBreakInThread = 149;
static final int[] checkedLines = { 163, 163, 196 };
static final int[] checkedLinesAlt = { 164, 164, 196 };
Comment on lines +80 to +82
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the added lines in the debuggee below.


//------------------------------------------------------ mutable common methods

Expand Down Expand Up @@ -248,7 +248,7 @@ private void setAndCheckStepEvent ( BreakpointRequest bpRequest,
exitCode = FAILED;
}

ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
ThreadReference thread = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName);
StepRequest stepRequest = setStepRequest( thread,
StepRequest.STEP_LINE,
stepDepth,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, 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 @@ -58,6 +58,9 @@ public class crstepreq004a {
private static volatile boolean isFirstThreadReady = false;
private static volatile boolean isSecondThreadReady = false;

static Thread thread1;
static Thread thread2;

//------------------------------------------------------ mutable common method

public static void main (String argv[]) {
Expand Down Expand Up @@ -95,8 +98,8 @@ public static void main (String argv[]) {
private static void runTestCase(int testCaseId) {
isFirstThreadReady = false;
isSecondThreadReady = false;
Thread thread1 = JDIThreadFactory.newThread(new Thread1crstepreq004a("thread1"));
Thread thread2 = JDIThreadFactory.newThread(new Thread2crstepreq004a("thread2"));
thread1 = JDIThreadFactory.newThread(new Thread1crstepreq004a("thread1"));
thread2 = JDIThreadFactory.newThread(new Thread2crstepreq004a("thread2"));
synchronized (lockObj) {
thread1.start();
while (!isFirstThreadReady) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private void testRun()
testClassReference =
(ReferenceType) vm.classesByName(testedClassName).get(0);

thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

eventRequest1 = setting21StepRequest(thread1, testClassReference,
EventRequest.SUSPEND_NONE, property1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private void testRun()
switch (i) {

case 0:
ThreadReference thread1 = debuggee.threadByNameOrThrow("thread1");
ThreadReference thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, "thread1");
eventRequest1 = setting23StepRequest(thread1, testedClassName1,
EventRequest.SUSPEND_NONE, property1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest with depth StepRequest.STEP_INTO");
eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest with depth StepRequest.STEP_OVER");
eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest with depth StepRequest.STEP_OUT");
eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest with size StepRequest.STEP_MIN");
eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_MIN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest with size StepRequest.STEP_LINE");
eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void testRun()
switch (i) {

case 0:
thread1 = debuggee.threadByNameOrThrow(threadName1);
thread1 = debuggee.threadByFieldNameOrThrow(debuggeeClass, threadName1);

log2("......setting up StepRequest with size StepRequest.STEP_MIN");
eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_MIN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private void testRun()
}

String thread2Name = "thread2";
ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
ThreadReference thread2Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread2Name);


String poppedMethod = "poppedMethod";
Expand All @@ -311,7 +311,7 @@ private void testRun()

log2("......setting breakpoint in poppedMethod");
try {
breakpointRequest = settingBreakpoint(debuggee.threadByNameOrThrow(thread2Name),
breakpointRequest = settingBreakpoint(thread2Ref,
debuggeeClass,
poppedMethod, breakpointLine, "one");
} catch ( Exception e ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ private void testRun()
breakpointForCommunication();

String thread2Name = "thread2";
ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
ThreadReference thread2Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread2Name);

String thread3Name = "thread3";
ThreadReference thread3Ref = debuggee.threadByNameOrThrow(thread3Name);
ThreadReference thread3Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread3Name);

String poppedMethod = "poppedMethod";
String breakpointLine = "breakpointLine";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ private void testRun()


String thread2Name = "thread2";
ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
ThreadReference thread2Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread2Name);

String thread3Name = "thread3";
ThreadReference thread3Ref = debuggee.threadByNameOrThrow(thread3Name);
ThreadReference thread3Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread3Name);

String poppedMethod = "poppedMethod";
String breakpointLine = "breakpointLine";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private void testRun()
breakpointForCommunication();

String thread2Name = "thread2";
ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
ThreadReference thread2Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread2Name);

StackFrame stackFrame = null;
int var;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private void testRun()
breakpointForCommunication();

String thread2Name = "thread2";
ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
ThreadReference thread2Ref = debuggee.threadByFieldNameOrThrow(debuggeeClass, thread2Name);

StackFrame stackFrame0 = null;
StackFrame stackFrame1 = null;
Expand Down
Loading