-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Refactor how launch
and attach
requests work.
#12
Conversation
@Tiwalun , @Yatekii , @huntc, @MabezDev I would really appreciate if you could take a few minutes to review (and comment on) this proposal. It is a big chunk of work, and I'd like to get at least your alignment before I make the investment. I think it will be worth it to improve the user experience and ensure long term success/adoption of the debug extension. Also, please feel free to invite others to comment if you think they can add to this discussion. |
Sounds good to me 👍. I wrote the original issue, and this is exactly the kind of change I had in mind. |
launch
and attach
requests work.launch
and attach
requests work.
launch
and attach
requests work.launch
and attach
requests work.
@Tiwalun Please review this PR, and keep in mind that it has to be synched with both:
cc: @Yatekii |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work :)
Just 2 smaller nits. Other than that it is looking great :)
bors d=noppej
✌️ noppej can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
854: Refactor how launch and attach requests work. r=noppej a=noppej This is a refactoring of `probe-rs-debugger` code that is driven by changes documented in [VS Code extension PR # 12](probe-rs/vscode#12) Co-authored-by: JackN <noppej@hotmail.com>
Build succeeded: |
This PR was motivated by discussions in #7, and will require rework of the equivalent functionality in probe-rs-debugger. It will involve a big code change in both repo's.
In the first iterations of this extension, the
launch
andattach
terminology was interpreted to apply to the debug adapter process. In other words, "launch a new instance of the debug adapter", or "attach to a to an existing debug adapter process". - Both operations allowed flashing and resetting of the target process running on the probe.The proposed change will reinterpret the
launch
andattach
terminology to apply to the target process running on the probe. To help clarify the different behaviours, I will use the following terminology:launch
orattach
request, and ...disconnect
request, or chooses toStop
a host side debug session.Reset
request, or when the device looses power.launch
request typei. Connect to the target device and executes a
Reset
request so that a new target session is startedii. Optionally flashes the target device firmware with the binary to be executed
attach
request typei. Connect to the target device, but do NOT issue `Reset, so that the existing target session is uninterrupted
Common behaviour to both
launch
andattach
request typesReset
request will causeprobe-rs
, to restart the target device, and associated target session.i. This will honour the value of the
halt_after_reset
flag.ii. The debug session is not affected.
Disconnect
request in the debug session will ...i. Instruct
probe-rs
to disconnect from the target device.ii. This implicitly ends the debug session.
iii. The state of the target session is not affected.
iv. There are some subtleties depending on
launch
vsattach
as described in the MS DAP Specification for the Disconnect RequestStop
function (Terminate
request) in the debug session will behave the same as thedisconnect
, except ...i. The debug session will send a
stop
request tohalt
the target session before disconnecting.ii. There are some subtleties depending on
launch
vsattach
as described in the MS DAP Specification for the Terminate RequestRunning
probe-rs-debugger
as a standalone for a VSCode debug sessionIn most cases, the VSCode debug extension will take care of automatically launching (and ending) the
probe-rs-debugger
executable to act as the debug adapter forprobe-rs
.It is possible for the user to take control of this, by running
probe-rs-debugger
from the command line, with the following commandprobe-rs-debugger debug --dap --port <any availably TCP/IP port number>
Any VSCode debug session can then attach to the specified on the server where
probe-rs-debugger
runs, and use the functionality above.i. In order for VSCode to know where to find the debug adapter, the user needs to add the appropriate TCP host IP address and port number to the
launch.json
configuration, by adding the option"server":"<host address>:<port number>"
(e.g."server":"127.0.0.1:50000"
)ii. Such a server debug session will put the management (start and stop) of the
probe-rs-debugger
process completely under control of the user.Further reading:
The above proposal aims to be consistent with the process described in the VSCode debug docs