Bug 517653

Summary: Show copy & pasteable -agentlib:jdwp option Remote Java Application debug configuration
Product: [Eclipse Project] JDT Reporter: Andreas Sewe <sewe>
Component: DebugAssignee: Andreas Sewe <sewe>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, loskutov, sarika.sinha
Version: 4.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Andreas Sewe CLA 2017-06-01 11:40:29 EDT
This would IMHO be a nice usability improvement:

When the user create a new "Remote Java Application" debug configuration, show a copy & pasteable command-line argument to connect to the remote VM

  -agentlib:jdwp=transport=dt_socket,address=$HOST:$PORT,server=y,suspend=y

pre-filled with "Host" and "Port" from the Connection Properties". I find myself googling for the exact argument a lot.

(Granted, this command-line argument is JVM-specific, but for the most common case, the above would be enough.)
Comment 1 Andrey Loskutov CLA 2017-06-02 10:40:40 EDT
Good idea. This could go into the not editable text area below the connection properties. Do you want to contribute? The patch will be in org.eclipse.jdt.debug.ui.launchConfigurations.JavaConnectTab
Comment 2 Andreas Sewe CLA 2017-06-02 10:47:46 EDT
(In reply to Andrey Loskutov from comment #1)
> Good idea. This could go into the not editable text area below the
> connection properties. Do you want to contribute? The patch will be in
> org.eclipse.jdt.debug.ui.launchConfigurations.JavaConnectTab

I can try. Let's see whether the wiki [1] is sufficient to get me started.

[1] <https://wiki.eclipse.org/Debug/Developers#Contributing_to_JDT_or_Platform_Debug>
Comment 3 Andreas Sewe CLA 2017-06-02 11:42:01 EDT
(In reply to Andrey Loskutov from comment #1)
> Good idea. This could go into the not editable text area below the
> connection properties. Do you want to contribute? The patch will be in
> org.eclipse.jdt.debug.ui.launchConfigurations.JavaConnectTab

Looks like this is more complicated than just adding a Label to a Group. The contents of the "Connection Properties" group are generated dynamically based on the registered org.eclipse.jdt.launching.vmConnectors extensions.

The nicest solution would be adding a IVMConnector.getConnectionHint(Map<String, String>) or getConnectionHint(Map<String,Connector.Argument>) method, that returns a hint based on the arguments the user has entered in the UI so far. AFAICT, this would require adding an IVMConnectorExtension interface, however, to not break existing implementers of IVMConnector.

Thoughts?
Comment 4 Sarika Sinha CLA 2017-06-07 05:58:21 EDT
(In reply to Andreas Sewe from comment #3)
> (In reply to Andrey Loskutov from comment #1)
> > Good idea. This could go into the not editable text area below the
> > connection properties. Do you want to contribute? The patch will be in
> > org.eclipse.jdt.debug.ui.launchConfigurations.JavaConnectTab
> 
> Looks like this is more complicated than just adding a Label to a Group. The
> contents of the "Connection Properties" group are generated dynamically
> based on the registered org.eclipse.jdt.launching.vmConnectors extensions.
> 
> The nicest solution would be adding a
> IVMConnector.getConnectionHint(Map<String, String>) or
> getConnectionHint(Map<String,Connector.Argument>) method, that returns a
> hint based on the arguments the user has entered in the UI so far. AFAICT,
> this would require adding an IVMConnectorExtension interface, however, to
> not break existing implementers of IVMConnector.
> 
> Thoughts?

please attach a gerrit with this suggestion and we can see the impact.
Comment 5 Sarika Sinha CLA 2018-04-13 02:53:50 EDT
Moving out of 4.8.