Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Welcome Johan Compagner as a new technology.dltk Committer


  the last time i debugged a tomcat process (it's been a while now), i recall my having to start the server and then it sat around until i started the eclipse debugging session, which caused tomcat to startup and then allow the session to continue. i could disconnect from the session and tomcat would still be running, but there did not seem to be a way to reconnect without a restart.

  i thought dbpg worked the opposite - the ide had to be told to listen for incoming debugger connections and then when it got one, start the debugging process. that's what the docs for komodo say to do, and i can't start debugging a remote perl script in eclipse unless the dbgp server is running, and the only way i know of to do that is to launch a remote debugging session to start the server and then start the script on the remote host.

  if you're saying that eclipse needs to make an outbound connection to your process instead of the other way around, then it would seem to go against how all the other dbpg implementations work. check out the docs for the active state firefox plugin:

    http://aspn.activestate.com/ASPN/docs/Komodo/4.3/debugjs.html

  it says to put komodo in 'listen' mode (which would be the equivalent of launching a remote debug process) and then go into firefox and tell it to connect (which would be the equivalent of executing the script/whatever on the remote client).

On Tue, Apr 22, 2008 at 1:56 PM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
It works just as remote java debugging.

I dont have a process that i kick of.. It is long running already. It could be even already long running before i start eclipse...

For example in java, if i remote debug a java tomcat.
Then i create a remote launch configuration where i fill in the host and the port to connect to
The tomcat is configured with to start a debugger alone. That debug doesnt make a connection to eclipse .. no eclipse makes a connection to the tomcat.
By the way even none remote launch configs works like that in java the debug process always starts a ServerSocket and then eclipse makes a connection to it.
Only the _javascript_ debug works the other way around that the to debug program connects back to eclipse..

johan


On Tue, Apr 22, 2008 at 6:10 PM, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  wait - do we, maybe i am confused...

  if i debug a local perl process, kicking off the 'launch' starts the server listening for a connection and then when my program is run, it makes an outbound connection to the server and then it works. in the remote case, i kick off the 'remote' launch, which just sits and waits. then i head over to the remote host and kick off the perl process. as long as i've exported the proper environment variables, it connects and starts the debugging process.

  are you saying it is the reverse for the _javascript_ engine?

  i looked at the xpi plugin from the active state guys for this and it looks like it works the exact same way.


On Tue, Apr 22, 2008 at 12:00 PM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
Ahh but then we work differently

you say "dbgp services to start listening to incoming connections"
But it is the other way. the dbgp services has to make a connection. The ServerSocket is there at the remote _javascript_ engine process not the dpgp service.

Because how do i tell the already running process that it has to connect to the dpgp services server socket and at which port??

look this is part of a new DbgpClient class (instead of DbpgServer class):

public class DbgpClient extends DbgpWorkingThread {
    private final int port;

    private final int clientTimeout;

    private IDbgpServerListener listener;

    private DbgpDebugingEngine dbgpDebugingEngine;

    private DbgpSession session;

    protected synchronized void workingCycle() throws Exception, IOException {
        try {
            if (listener != null) {
                Socket client = new Socket("127.0.0.1",port); << see it opens a socket not waits for a socket.
                client.setSoTimeout(clientTimeout);
                   
                    try {
                        dbgpDebugingEngine = new DbgpDebugingEngine(client);
                        session = new DbgpSession(dbgpDebugingEngine);
                        listener.clientConnected(session);
                    }
                    catch (Exception e) {
                        DLTKDebugPlugin.log(e);
                        if (dbgpDebugingEngine != null)
                            dbgpDebugingEngine.requestTermination();
                    }
                }
        } catch (Exception e)
        {
            e.printStackTrace();

        }
    }


On Tue, Apr 22, 2008 at 5:49 PM, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  hrm - i didn't have to do any of that to get remote perl debugging up and running. as soon as you spawn a remote launch configuration, that should kick off the dbgp service to start listening for incoming connections. as long as you set the 'idekey' property in the remote launch config to be whatever you used on the remote side, it should just connect.

  of course, i could be missing something, or perhaps there was some other change that has occurred as of late (the day job has been keeping me pretty busy, so i'm playing some catch-up with the recent set of changes) that i haven't accounted for yet.



On Tue, Apr 22, 2008 at 11:40 AM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
No it works, only i have to handle disconnects and so on a bit more gracefull.
And launch configurations and other settings like port has to be better handed thats now pretty much hardcoded

But I remote debug a Rhino instance that is already running.
So instead of starting an instance i connect to it. I use the RemoteDebuggingEngineRunner that already is in the code base

public class ServoyDebuggableEngineFactory implements IInterpreterRunnerFactory
{

    public ServoyDebuggableEngineFactory()
    {
    }

    public IInterpreterRunner createRunner(IInterpreterInstall install)
    {
        return new RemoteDebuggingEngineRunner(install)
        {
            @Override
            protected String getDebugPreferenceQualifier()
            {
                return "servoy";
            }

        };
    }

}

But that didnt have any IDbgpService that it could use because the current one is purely there for starting a none remote one.
So what i did was created a class:

public class RemoteDbgpService implements IDbgpService,
        IDbgpTerminationListener, IDbgpServerListener

that can connect to an instance.

So the RemoteDebuggingEngine does this:

    protected IDbgpService getDbgpService()
    {
        return DLTKDebugPlugin.getDefault().getRemoteDbgpService();
    }

And apart from some disconnect issues that i have to handle a bit better (but on the client side not the eclipse debugger)
and the ports/addresses configuration stuff it works for us.

johan



On Tue, Apr 22, 2008 at 5:32 PM, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  i'd like to hear about your remote debugging work - what do you have working at this point in time? what doesn't work for you?


On Tue, Apr 22, 2008 at 11:30 AM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
Hi guys (and girls if there are any..;),

thx for letting me in!
I will concentrate my efforts most of the time on the _javascript_ side but sometimes it crosses over i guess to the more general side of dltk.

I have currently loads of patches standing out, the things that are purely _javascript_ and easy bug fixes or small improvements i will checkin
the coming days. For others i guess i will first start a discussion if it is meant this way. For example my implementation for Remote Debugging..
(there is some support, some interfaces but not a implementation yet)

Johan



On Tue, Apr 22, 2008 at 4:50 PM, portal on behalf of Andrey Platov <andrey@xxxxxxxxx> wrote:
technology.dltk Committers,
This automatically generated message marks the completion of all the legal
paperwork and webmaster provisioning for Johan Compagner. Johan Compagner
is a new full Committer on the technology.dltk project.

Welcome!
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae

Back to the top