Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Java debugger Python API #58

Open
michalgr opened this issue Sep 6, 2023 · 0 comments
Open

Implement Java debugger Python API #58

michalgr opened this issue Sep 6, 2023 · 0 comments

Comments

@michalgr
Copy link
Contributor

michalgr commented Sep 6, 2023

Raw JDWP is too verbose for convenient debugging experience. Ideally we would be able to debug Java processes using API consisting of Threads, StackFrames, Variables and Breakpoints that underneath translates all interactions to/from JDWP messages. The API should support two use cases:

  • Interactive debugging from Python REPL, for example
debugger = connect(...)
event = await debugger.on("void java.lang.Integer.toString()")
thread = event.thread
thread.stackTrace
thread.frame[0].this
thread.resume()
  • Scripting, users specifying set of breakpoints and reactions to breakpoints as standalone python scripts, for example:
debugger = connect(...)

@debugger.on("void java.lang.Integer.toString()")
async def callback(event: BreakpointEvent):
    thread = event.thread
    println(f"Called toString on ${thread.frame[0].this}")
    println(thread.stackTrace)
    event2 = await thread.singleStep()
    println(thread.stackTrace)    

Once completed we should be able to use new API to debug Java processes on host machine, as well as Java processes on Android devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant