summaryrefslogtreecommitdiff
path: root/rust/src/disassembly.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/disassembly.rs')
-rw-r--r--rust/src/disassembly.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/rust/src/disassembly.rs b/rust/src/disassembly.rs
index ed9b0854..cd5a860d 100644
--- a/rust/src/disassembly.rs
+++ b/rust/src/disassembly.rs
@@ -142,6 +142,14 @@ impl DisassemblyTextLine {
..Default::default()
}
}
+
+ pub fn new_with_addr(tokens: Vec<InstructionTextToken>, addr: u64) -> Self {
+ Self {
+ address: addr,
+ tokens,
+ ..Default::default()
+ }
+ }
}
impl From<&str> for DisassemblyTextLine {
@@ -308,6 +316,10 @@ impl InstructionTextToken {
}
}
+ /// Construct a new token **without** an associated address.
+ ///
+ /// You most likely want to call [`InstructionTextToken::new_with_address`], while also adjusting
+ /// the [`InstructionTextToken::expr_index`] field where applicable.
pub fn new(text: impl Into<String>, kind: InstructionTextTokenKind) -> Self {
Self {
address: 0,
@@ -493,13 +505,13 @@ pub enum InstructionTextTokenKind {
hash: Option<u64>,
},
CodeSymbol {
- // TODO: Value of what?
+ // Target address of the symbol
value: u64,
// TODO: Size of what?
size: usize, // TODO: Operand?
},
DataSymbol {
- // TODO: Value of what?
+ // Target address of the symbol
value: u64,
// TODO: Size of what?
size: usize, // TODO: Operand?