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

Support for debugging tasks #413

Open
davidanthoff opened this issue Jun 24, 2020 · 3 comments
Open

Support for debugging tasks #413

davidanthoff opened this issue Jun 24, 2020 · 3 comments

Comments

@davidanthoff
Copy link
Contributor

As far as I can tell there is currently no support to debug tasks that are started by code that is running in JuliaInterpreter, correct?

I think (but am not sure) that from the VS Code extension point of view the following would be a good design: we add another argument to debug_command called create_task_callback. Whenever JuliaInterpreter is about to run the (low level) statement that would create a new task it would then just call that callback instead and that callback is then in charge of actually creating the new task.

The call that JuliaInterpreter.jl would need to detect here is probably Core.Task.

The signature for the callback would be (f, reserved_stack::Int=0).

In the VS Code debugger, our implementation for that callback function would look like this in pseudo-code:

function task_create_callback(f, reserved_stack)
    new_f = () -> begin
        frame = construct_juliainterpreter_frame(...)
        setup_comm_with_debugger_msg_processing_task()
        while # our main normal debugger loop
            # get next command from debugger msg processing task
            debug_command(....)
        end
    end

    return Core.Task(new_f, reserved_stack)
end

For the UI we could then just treat each task as a thread, and thus expose tasks as primary objects in the debugger UI.

@MJLHThomassen-Sorama
Copy link

Any updatse on this?

@jjd35
Copy link

jjd35 commented Jan 16, 2024

Is this still going to be added at some point?

@timholy
Copy link
Member

timholy commented Jan 17, 2024

Anyone can submit a PR. It's not on my agenda, but perhaps it's on yours?

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

4 participants