-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'read register' command of the RSP protocol
In some architecture, Gdb will actually query single registers, for ex. on RISC-V. This commit introduces support for this command. To support this, the trait Target gained a new 'read_register' function, which is made optional to avoid breaking existing implementations.
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use super::prelude::*; | ||
|
||
#[derive(PartialEq, Eq, Debug)] | ||
pub struct p { | ||
pub reg_number: u32, | ||
} | ||
|
||
impl<'a> ParseCommand<'a> for p { | ||
fn from_packet(buf: PacketBuf<'a>) -> Option<Self> { | ||
let body = buf.as_body(); | ||
let reg_number = decode_hex(body).ok()?; | ||
Some(p { | ||
reg_number | ||
}) | ||
} | ||
} |
This file contains 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