-
-
Notifications
You must be signed in to change notification settings - Fork 75
Draft: Start a GDB server with --gdblisten 127.0.0.1:1337 #388
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,23 @@ pub struct Opts { | |
#[arg(long)] | ||
pub verify: bool, | ||
|
||
/// Sets which port we bind the GDB Server to. | ||
/// | ||
/// 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>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wondered if this should be $ 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good idea. We can always turn the valid socket address back into a string before giving it to the GDB server. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also we should warn if they provide a gdb-port but fail to activate either of the GDB options (-on-start or -on-fault) |
||
|
||
/// Starts the GDB Server right after flashing. | ||
/// | ||
/// You must use GDB to start the processor or it won't run. | ||
#[arg(long, conflicts_with = "gdb_on_fault")] | ||
pub gdb_on_start: bool, | ||
|
||
/// Starts the GDB Server only if the chip faults. | ||
#[arg(long, conflicts_with = "gdb_on_start")] | ||
pub gdb_on_fault: bool, | ||
|
||
/// Prints version information | ||
#[arg(short = 'V', long)] | ||
version: bool, | ||
|
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.
Please keep the alphabetical ordering. Makes it easier to scan through it.