11/*
2- * Copyright (c) 2002, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2002, 2024 , 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
@@ -103,52 +103,21 @@ public void launchJdbAndDebuggee (String classToExecute) throws IOException {
103103
104104 String [] jdbCmdArgs = makeJdbCmdLine (classToExecute );
105105
106- if (argumentHandler .isLaunchedLocally ()) {
107-
108- if (argumentHandler .isDefaultConnector ()) {
109-
110- localDefaultLaunch (jdbCmdArgs , classToExecute );
111-
112- } else if (argumentHandler .isRawLaunchingConnector ()) {
113-
114- localRawLaunch (jdbCmdArgs , classToExecute );
115-
116- } else if (argumentHandler .isLaunchingConnector ()) {
117-
118- localLaunch (jdbCmdArgs , classToExecute );
119-
120- } else if (argumentHandler .isAttachingConnector ()) {
121-
122- localLaunchAndAttach (jdbCmdArgs , classToExecute );
123-
124- } else if (argumentHandler .isListeningConnector ()) {
125-
126- localLaunchAndListen (jdbCmdArgs , classToExecute );
127-
128- } else {
129- throw new TestBug ("Unexpected connector type for local launch mode"
130- + argumentHandler .getConnectorType ());
131- }
132-
133- } else if (argumentHandler .isLaunchedRemotely ()) {
134-
135- connectToBindServer (classToExecute );
136-
137- if (argumentHandler .isAttachingConnector ()) {
138-
139- remoteLaunchAndAttach (jdbCmdArgs , classToExecute );
140-
141- } else if (argumentHandler .isListeningConnector ()) {
142-
143- remoteLaunchAndListen (jdbCmdArgs , classToExecute );
144-
145- } else {
146- throw new TestBug ("Unexpected connector type for remote launch mode"
147- + argumentHandler .getConnectorType ());
148- }
106+ if (argumentHandler .isDefaultConnector ()) {
107+ localDefaultLaunch (jdbCmdArgs , classToExecute );
108+ } else if (argumentHandler .isRawLaunchingConnector ()) {
109+ localRawLaunch (jdbCmdArgs , classToExecute );
110+ } else if (argumentHandler .isLaunchingConnector ()) {
111+ localLaunch (jdbCmdArgs , classToExecute );
112+ } else if (argumentHandler .isAttachingConnector ()) {
113+ localLaunchAndAttach (jdbCmdArgs , classToExecute );
114+ } else if (argumentHandler .isListeningConnector ()) {
115+ localLaunchAndListen (jdbCmdArgs , classToExecute );
149116 } else {
150- throw new Failure ("Unexpected launching mode: " + argumentHandler .getLaunchMode ());
117+ throw new TestBug ("Unexpected connector type for local launch mode"
118+ + argumentHandler .getConnectorType ());
151119 }
120+
152121 }
153122
154123 /**
@@ -198,11 +167,7 @@ private String[] makeJdbCmdLine (String classToExecute) {
198167 if (argumentHandler .isRawLaunchingConnector ()) {
199168
200169 if (argumentHandler .isSocketTransport ()) {
201- if (argumentHandler .isLaunchedLocally ()) {
202- connectorAddress = argumentHandler .getTransportPort ();
203- } else {
204- connectorAddress = argumentHandler .getDebugeeHost () + ":" + argumentHandler .getTransportPort ();
205- }
170+ connectorAddress = argumentHandler .getTransportPort ();
206171 } else if (argumentHandler .isShmemTransport () ) {
207172 connectorAddress = argumentHandler .getTransportSharedName ();
208173 } else {
@@ -247,8 +212,6 @@ private String[] makeJdbCmdLine (String classToExecute) {
247212
248213 if (argumentHandler .isSocketTransport ()) {
249214 connect .append ("port=" + argumentHandler .getTransportPort ().trim ());
250- if (argumentHandler .isLaunchedRemotely ())
251- connect .append (",hostname=" + argumentHandler .getDebugeeHost ().trim ());
252215 } else if (argumentHandler .isShmemTransport ()) {
253216 connect .append ("name=" + argumentHandler .getTransportSharedName ().trim ());
254217 } else {
@@ -324,7 +287,7 @@ private String[] makeJdbCmdLine (String classToExecute) {
324287 private void localLaunchAndAttach
325288 (String [] jdbCmdArgs , String classToExecute ) throws IOException {
326289
327- debuggee = new LocalLaunchedDebuggee (this );
290+ debuggee = new Debuggee (this );
328291 String address = makeTransportAddress ();
329292 String [] javaCmdArgs = makeCommandLineArgs (classToExecute , address );
330293 debuggee .launch (javaCmdArgs );
@@ -346,57 +309,12 @@ private String[] makeJdbCmdLine (String classToExecute) {
346309 String address = jdb .waitForListeningJdb ();
347310 display ("Listening address found: " + address );
348311
349- debuggee = new LocalLaunchedDebuggee (this );
312+ debuggee = new Debuggee (this );
350313 String [] javaCmdArgs = makeCommandLineArgs (classToExecute , address );
351314 debuggee .launch (javaCmdArgs );
352315
353316// jdb.waitForPrompt(0, false);
354317 }
355318
356- /**
357- * Run test in remote mode using attaching connector.
358- */
359- private void remoteLaunchAndAttach
360- (String [] jdbCmdArgs , String classToExecute ) throws IOException {
361-
362- debuggee = new RemoteLaunchedDebuggee (this );
363- String address = makeTransportAddress ();
364- String [] javaCmdArgs = makeCommandLineArgs (classToExecute , address );
365- try {
366- debuggee .launch (javaCmdArgs );
367- } catch (IOException e ) {
368- throw new Failure ("Caught exception while launching debuggee VM process:\n \t "
369- + e );
370- };
371-
372- display ("Start jdb attaching to remote debuggee" );
373- jdb = Jdb .startAttachingJdb (this , jdbCmdArgs , JDB_STARTED );
374- // jdb.waitForPrompt(0, false);
375- }
376-
377- /**
378- * Run test in remote mode using listening connector.
379- */
380- private void remoteLaunchAndListen
381- (String [] jdbCmdArgs , String classToExecute ) throws IOException {
382-
383- jdb = new Jdb (this );
384- display ("Starting jdb listening to remote debuggee" );
385- jdb .launch (jdbCmdArgs );
386- String address = jdb .waitForListeningJdb ();
387- display ("Listening address found: " + address );
388-
389- debuggee = new RemoteLaunchedDebuggee (this );
390- String [] javaCmdArgs = makeCommandLineArgs (classToExecute );
391- try {
392- debuggee .launch (javaCmdArgs );
393- } catch (IOException e ) {
394- throw new Failure ("Caught exception while launching debuggee VM process:\n \t "
395- + e );
396- };
397-
398- jdb .waitForMessage (0 , JDB_STARTED );
399- // jdb.waitForPrompt(0, false);
400- }
401319
402320} // End of Launcher
0 commit comments