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

This is indeed not a trivial task. If I may ask, did you started to implement some prototype which I could browse, or was the reflexion only theorical?

Emmanuel

Le 03/05/2019 à 21:58, Doug Schaefer a écrit :
I think with the debug adapter protocol it would be a lot easier now to do the composite approach. We had considered how to do this with JNI with JDT and CDT debuggers but couldn't get past how complicated that architecture would be, especially in situations, like producing a stack, that you would want to combine information from both debuggers.

Sounds cool, though. Be really cool if you could get it working well.
Doug.


From: lsp4e-dev-bounces@xxxxxxxxxxx [lsp4e-dev-bounces@xxxxxxxxxxx] on behalf of Emmanuel Chebbi [emmanuel.chebbi@xxxxxxxxxx]
Sent: Friday, May 03, 2019 3:03 PM
To: lsp4e-dev@xxxxxxxxxxx
Subject: [lsp4e-dev] How can I use several debuggers at once

Hello everyone,

I am trying to integrate a custom language (let's call it 'CL') within Eclipse IDE.

This language is executed by a Java interpreter thanks to a dedicated launch configuration. I am now trying to implement a debugger. The difficulty is that a program written in CL can execute scripts (a single file) written in any other language (such as Java or Python) and I don't know how I can allow the user to debug them as well.

Ideally, I would like to rely on existing debuggers such as the ones providing by JDT, CDT or PyDev. Concretely, I'd like the user to  be able to:

  1. Create a script in Java/Python/whatever
  2. Add a breakpoint within the file
  3. Create a CL program that uses the script
  4. Launch the program in debug mode
  5. Wait for the breakpoint to be handled by the debugger provided by JDT/PyDev/whatever
  6. Benefit from the Debug perspective to check stacktrace, variables, etc.

For completeness about the way scripts are currently executed:

  • Each script is wrapped as a Java object:
    • for _javascript_s I just load the class from the classpath
    • for Python scripts the Java object uses Py4J to execute the script

I thought about several solutions:

  • relying on JDT/CDT/whatever to launch the script, but that would be a bit cumbersome and sharing data between the Java interpreter and the script would be hard
  • creating kind of a CompositeDebugTarget that would somehow delegate events to available debuggers so that they can handle them but I'm not sure whether it's actually practical

I hope my explanations are clear enough; would you have any idea on how I could achieve this? I am using neither LSP nor the Debug Protocol at the moment but I don't mind switching if it helps solving the issue.

Thanks to whose who took the time to read,

Best regards,
Emmanuel


_______________________________________________
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