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

Can't step into standard library when debugging #100

Open
staticintlucas opened this issue Jul 1, 2024 · 3 comments · May be fixed by probe-rs/probe-rs#2635
Open

Can't step into standard library when debugging #100

staticintlucas opened this issue Jul 1, 2024 · 3 comments · May be fixed by probe-rs/probe-rs#2635
Labels
enhancement New feature or request

Comments

@staticintlucas
Copy link

If I try to step into any standard library function the source file is not found, which can be pretty annoying:

image

Rust standard libraries use the source path translation: /rustc/<commit-hash><sysroot>/lib/rustlib/src/rust

rust-analyzer takes care of this translation automatically here: https://github.com/rust-lang/rust-analyzer/blob/1b283db47f8de1412c851c92bb4ce4ef039ff8ff/editors/code/src/debug.ts#L144

Would it be possible to support the same here too?

@noppej
Copy link
Contributor

noppej commented Jul 2, 2024

It is definitely possible, and would be a nice addition. The implementation would be in dap-server component of the https://github.com/probe-rs/probe-rs repo. I'd be more than happy to help you get started on that code base if you want to submit a PR.

@noppej noppej added the enhancement New feature or request label Jul 2, 2024
@staticintlucas
Copy link
Author

The implementation would be in dap-server component of the https://github.com/probe-rs/probe-rs repo.

Ah sorry, didn't realise it was there

I'd be more than happy to help you get started on that code base if you want to submit a PR.

Yeah I'd be happy to work on a PR if you gave me a few pointer on where to look

@noppej
Copy link
Contributor

noppej commented Jul 3, 2024

As a starting point, have a look at the DAP specification for Source. We construct this in the dap-server as part of creating a StackFrame from the stack trace information.

My first instinct suggests that you will need to specify a sourceReference in the StackFrame definition, so that it forces the client to issue a Source request, where the 'translation' you refer to above, will be implemented.

Once you've had a look at that, the next step I'd suggest is to create a PR in the probe-rs repo, and then tag me from there to continue the conversation in more detail.

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

Successfully merging a pull request may close this issue.

2 participants