Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lsp4e-dev] How can I use several debuggers at once

I thought about implementing a composite Debug Adapter but I don't know if it's actually feasible.

The issue is that debuggers seem to be tightly coupled to their interpreters and to need full control over the execution of the program. For instance, AFAIK, in order to debug a Java program, JDT spawns a new VM and then relies on the Java Debug Interface (JDI) [1][2] to provide debugging utilities. As a result, I think that currently the only way to re-use those debuggers would be to use the existing API to create then launch corresponding debug configurations.

In my case, the execution of scripts is currently delegated to Java wrappers that allow, among other things, to share data (i.e. variables) between the main program (written in CL) and the scripts (written in Java, Python, etc.). Those wrappers could certainly be upgraded to use debug configurations under the hood, but it may make very hard to share data and will likely decrease performances as well.

With this in mind, maybe that I do not really have any other alternative. I guess that I need more time to think about it. Maybe also getting in touch with JDT and EASE teams could bring new point of views?

Mickael, do you have an idea of how this composite Debug Adapter could be implemented? Am I missing something?

Thanks,
Emmanuel

 [1] https://docs.oracle.com/javase/8/docs/jdk/api/jpda/jdi/
 [2] https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/tree/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java

Le 03/05/2019 à 22:00, Mickael Istria a écrit :
Hi,

Eclipse LSP4E includes support the Debug Adapter Protocol ( https://microsoft.github.io/debug-adapter-protocol/ ) that's also used in VSCode, Eclipse Che and Eclipse Theia, and provides debug targets and model for it in Eclipse IDE. The Debug Adapter is independent of the language, so it can run with any language and probably with a combination of them.
So one possibility here would be that you implement a single multi-language/composite Debug Adapter that would receive messages from client IDE (Eclipse IDE) when adding a breakpoint, clicking "Next" or looking for a value or ..., and that would dispatch it to the right debugger for the desired file. Eclipse LSP4E (and other clients) wouldn't really care if the file where to place the breakpoint or to show the value is a .java or a .python or whatever, it will just communicate the actions with the Debug Adapter, which does whatever it wants with it. From Eclipse IDE perspective, it would be a single debugger.

HTH

_______________________________________________
lsp4e-dev mailing list
lsp4e-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lsp4e-dev

Back to the top