Skip to content

Commit

Permalink
Update single_step_gdb_behavior of all architectures with proper va…
Browse files Browse the repository at this point in the history
…lue (#95)

* Update single_step_gdb_behavior of all architectures with proper value

* Add back SingleStepGdbBehavior::Unknown
  • Loading branch information
bet4it committed Jan 30, 2022
1 parent d22eea8 commit a6e9703
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 25 deletions.
6 changes: 2 additions & 4 deletions gdbstub_arch/src/msp430/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ impl Arch for Msp430 {

#[inline(always)]
fn single_step_gdb_behavior() -> SingleStepGdbBehavior {
// TODO: update with proper value
SingleStepGdbBehavior::Unknown
SingleStepGdbBehavior::Required
}
}

Expand All @@ -39,7 +38,6 @@ impl Arch for Msp430X {

#[inline(always)]
fn single_step_gdb_behavior() -> SingleStepGdbBehavior {
// TODO: update with proper value
SingleStepGdbBehavior::Unknown
SingleStepGdbBehavior::Required
}
}
3 changes: 1 addition & 2 deletions gdbstub_arch/src/ppc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ impl<RegIdImpl: RegId> Arch for PowerPcAltivec32<RegIdImpl> {

#[inline(always)]
fn single_step_gdb_behavior() -> SingleStepGdbBehavior {
// TODO: update with proper value
SingleStepGdbBehavior::Unknown
SingleStepGdbBehavior::Required
}
}
10 changes: 4 additions & 6 deletions gdbstub_arch/src/riscv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ impl Arch for Riscv32 {
type BreakpointKind = usize;

fn target_description_xml() -> Option<&'static str> {
Some(r#"<target version="1.0"><architecture>riscv</architecture></target>"#)
Some(r#"<target version="1.0"><architecture>riscv:rv32</architecture></target>"#)
}

#[inline(always)]
fn single_step_gdb_behavior() -> SingleStepGdbBehavior {
// TODO: update with proper value
SingleStepGdbBehavior::Unknown
SingleStepGdbBehavior::Ignored
}
}

Expand All @@ -36,12 +35,11 @@ impl Arch for Riscv64 {
type BreakpointKind = usize;

fn target_description_xml() -> Option<&'static str> {
Some(r#"<target version="1.0"><architecture>riscv64</architecture></target>"#)
Some(r#"<target version="1.0"><architecture>riscv:rv64</architecture></target>"#)
}

#[inline(always)]
fn single_step_gdb_behavior() -> SingleStepGdbBehavior {
// TODO: update with proper value
SingleStepGdbBehavior::Unknown
SingleStepGdbBehavior::Ignored
}
}
14 changes: 1 addition & 13 deletions src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,6 @@ pub trait Arch {
/// pre-init error that informs the user of the potential issues they may
/// run into.
///
/// # `Unknown` implementations
///
/// Because this method was only introduced in `gdbstub` version 0.6, there
/// are many existing `Arch` implementations in the
/// [`gdbstub_arch`](https://docs.rs/gdbstub_arch/) companion crate that
/// have not yet been tested and updated what kind of behavior they exhibit.
///
/// These implementations currently return
/// [`SingleStepGdbBehavior::Unknown`], which will result in a pre-init
/// error that notifies users of this issue, along with imploring them
/// to be a Good Citizen and discover + upstream a proper implementation
/// of this method for their `Arch`.
///
/// # Writing a proper implementation
///
/// To check whether or not a particular architecture exhibits this
Expand Down Expand Up @@ -265,5 +252,6 @@ pub enum SingleStepGdbBehavior {
Ignored,
/// Unknown behavior - no one has tested this platform yet. If possible,
/// please conduct a test + upstream your findings to `gdbstub_arch`.
#[doc(hidden)]
Unknown,
}

0 comments on commit a6e9703

Please sign in to comment.