Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
TargetDescriptionXmlOverride
extension (#43)
* add target description XML override extension * more consistent naming * doc tweaks
- Loading branch information
1 parent
cd5d04b
commit 1593da2
Showing
7 changed files
with
68 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use gdbstub::target; | ||
|
||
use crate::emu::Emu; | ||
|
||
impl target::ext::target_description_xml_override::TargetDescriptionXmlOverride for Emu { | ||
fn target_description_xml(&self) -> &str { | ||
r#"<target version="1.0"><!-- custom override string --><architecture>armv4t</architecture></target>"# | ||
} | ||
} |
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
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,22 @@ | ||
//! Override the target description XML specified by `Target::Arch`. | ||
use crate::target::Target; | ||
|
||
/// Target Extension - Override the target description XML specified by | ||
/// `Target::Arch`. | ||
/// | ||
/// _Note:_ Unless you're working with a particularly dynamic, | ||
/// runtime-configurable target, it's unlikely that you'll need to implement | ||
/// this extension. | ||
pub trait TargetDescriptionXmlOverride: Target { | ||
/// Return the target's description XML file (`target.xml`). | ||
/// | ||
/// Refer to the | ||
/// [target_description_xml](crate::arch::Arch::target_description_xml) | ||
/// docs for more info. | ||
fn target_description_xml(&self) -> &str; | ||
} | ||
|
||
define_ext!( | ||
TargetDescriptionXmlOverrideOps, | ||
TargetDescriptionXmlOverride | ||
); |
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