This repository was archived by the owner on Jan 30, 2024. It is now read-only.
Draft: Start a GDB server with --gdblisten 127.0.0.1:1337 - #388
Draft
jonathanpallant wants to merge 4 commits into
Draft
Draft: Start a GDB server with --gdblisten 127.0.0.1:1337#388jonathanpallant wants to merge 4 commits into
jonathanpallant wants to merge 4 commits into
Conversation
TODO: Turn down some warning logs TODO: Stop the GDB server when probe-run exits.
Adds separate argument/env var for GDB Server port. The default is 127.0.0.1:3333.
Urhengulas
reviewed
Mar 10, 2023
| object = { version = "0.30", default-features = false } | ||
| probe-rs = "0.17" | ||
| signal-hook = "0.3" | ||
| gdb-server = "0.17" |
Member
There was a problem hiding this comment.
Please keep the alphabetical ordering. Makes it easier to scan through it.
| /// Note: doesn't necessarily start the GDB Server. See `--gdb-on-start` and | ||
| /// `--gdb-on-crash`. | ||
| #[arg(long, env = "PROBE_RUN_GDB_PORT")] | ||
| pub gdb_port: Option<String>, |
Member
There was a problem hiding this comment.
I wondered if this should be Option<SocketAddr> instead? This will give users a suitable error message if they provide an invalid address.
$ cargo run -- --gdbport 127.0.0:3333
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
Running `target/debug/krate --gdbport '127.0.0:3333'`
error: invalid value '127.0.0:3333' for '--gdbport <GDBPORT>': invalid socket address syntax
For more information, try '--help'.But, since GdbInstanceConfiguration::from_session takes a Option<impl Into<String>>, I am unsure.
Contributor
Author
There was a problem hiding this comment.
That's a good idea. We can always turn the valid socket address back into a string before giving it to the GDB server.
Contributor
Author
There was a problem hiding this comment.
Also we should warn if they provide a gdb-port but fail to activate either of the GDB options (-on-start or -on-fault)
Urhengulas
marked this pull request as draft
May 15, 2023 16:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO: