GitHub user tretonio edited a discussion: plugin invoke "Debug Attach"

plugin invoke debug attach

I need the plugin to call
Debugger = JPDA
Connector = Socket Attach
Transport = dt_socket
Host = localhost
Port = 5005
Timeout = 5000

The goal is to perform some processing and then call "Debug Attach" 
automatically and have it open the developer's debug session.

I would like to point out that everything works manually using "Debug Attach".

It is possible to add this type of resource to the plugin, I would appreciate 
if you could help me.

I tried this way but without any success

Does not work

How to solve?

                
 ```
public void attachDebug() {

              for (AttachingConnector ac : 
Bootstrap.virtualMachineManager().attachingConnectors()) {
                    if ("com.sun.jdi.SocketAttach".equals(ac.name())) {
                        System.out.println("conector-> "  + ac.name() );
                        connector = ac;
                        break;
                    }
                }

                if (connector == null) {
                    System.err.println("JPDA SocketAttach connector not 
found.");
                    return;
                }
                
 
                Map<String, Connector.Argument> args = 
connector.defaultArguments();
                args.get    ("hostname").setValue("localhost");
                args.get("port").setValue(5005;
                args.get("timeout").setValue("10000");
             
                AttachingDICookie cookie = AttachingDICookie.create(connector, 
args);
            
                DebuggerInfo info = DebuggerInfo.create(
                   "JPDA_ATTACH",           
                   new Object[]{cookie}     
               );  
           
            
               DebuggerEngine[] engines = 
DebuggerManager.getDebuggerManager().startDebugging(info);            
               System.out.println("Engines: " + engines.length);
}

```
`

GitHub link: https://github.com/apache/netbeans/discussions/8416

----
This is an automatically sent email for notifications@netbeans.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@netbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to