Closed ptosi closed 2 years ago
Sorry for forgetting about documentation, that's fixed. And thanks for explaining what's expected from the armv4t test, I've added support for an "Unavailable
" register and updated this PR description with the GDB/test outputs.
Note that check_size.sh
seems broken:
$ example_no_std/check_size.sh
Compiling gdbstub v0.6.2 (/usr/local/google/home/ptosi/src/gdbstub)
Finished release [optimized] target(s) in 3.21s
Finished release [optimized] target(s) in 0.02s
Error: only 'bin', 'dylib' and 'cdylib' crate types are supported.
Should it be fixed?
All good 👍
Ahh, yeah, check_size.sh
assumes you're running it from inside the example_no_std
directory.
I should probably make that more clear.
rustfmt
should be happy, now!
Output of example_no_std/check_size.sh
added.
Description
Make gdbstub report to the GDB client the state of an unavailable (but valid) register by following the registers packet protocol:
API Stability
Option
instead of the C-ish approach of giving special meaning to0
Checklist
rustdoc
formatting looks good (viacargo doc
)examples/armv4t
withRUST_LOG=trace
+ any relevant GDB output under the "Validation" section below./example_no_std/check_size.sh
before/after changes under the "Validation" section belowValidation
GDB output
``` (gdb) info registers SPSR_EL3 SPSR_EL3examples/armv4t
``` $ RUST_LOG=trace cargo run --example armv4t Compiling gdbstub v0.6.2 (/usr/local/google/home/ptosi/src/gdbstub) Finished dev [unoptimized + debuginfo] target(s) in 1.76s Running `target/debug/examples/armv4t` loading section ".text" into memory from [0x55550000..0x55550078] Setting PC to 0x55550000 Waiting for a GDB connection on "127.0.0.1:9001"... ``` then ``` (gdb) target remote localhost:9001 ``` makes the GDB client learn about the `Unavailable` register through the XML: ``` Debugger connected from 127.0.0.1:33718 TRACE gdbstub::protocol::recv_packet > <-- + TRACE gdbstub::protocol::recv_packet > <-- $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386#6a TRACE gdbstub::protocol::response_writer > --> $PacketSize=1000;vContSupported+;multiprocess+;QStartNoAckMode+;ReverseContinue+;ReverseStep+;QDisableRandomization+;QEnvironmentHexEncoded+;QEnvironmentUnset+;QEnvironmentReset+;QStartupWithShell+;QSetWorkingDir+;swbreak+;hwbreak+;QCatchSyscalls+;qXfer:features:read+;qXfer:memory-map:read+;qXfer:exec-file:read+;qXfer:auxv:read+#fa [...] TRACE gdbstub::protocol::recv_packet > <-- $qXfer:features:read:extra.xml:0,ffb#16 TRACE gdbstub::protocol::response_writer > --> $mBefore/After `./example_no_std/check_size.sh` output
### Before ``` File .text Size Crate Name 2.9% 72.7% 10.9KiB [Unknown] main 0.2% 4.6% 706B gdbstub gdbstub::stub::state_machine::GdbStubStateMachineInner