summaryrefslogtreecommitdiff
path: root/rust/src/low_level_il
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/low_level_il')
-rw-r--r--rust/src/low_level_il/expression.rs10
-rw-r--r--rust/src/low_level_il/function.rs6
2 files changed, 8 insertions, 8 deletions
diff --git a/rust/src/low_level_il/expression.rs b/rust/src/low_level_il/expression.rs
index fd403c76..f8fcf9f7 100644
--- a/rust/src/low_level_il/expression.rs
+++ b/rust/src/low_level_il/expression.rs
@@ -21,7 +21,7 @@ use super::VisitorAction;
use super::*;
use crate::architecture::Architecture;
use std::fmt;
-use std::fmt::{Display, Formatter};
+use std::fmt::{Debug, Display, Formatter};
use std::marker::PhantomData;
/// Used as a marker for an [`LowLevelILExpression`] that **can** produce a value.
@@ -32,7 +32,7 @@ pub struct ValueExpr;
#[derive(Copy, Clone, Debug)]
pub struct VoidExpr;
-pub trait ExpressionResultType: 'static {}
+pub trait ExpressionResultType: 'static + Debug {}
impl ExpressionResultType for ValueExpr {}
impl ExpressionResultType for VoidExpr {}
@@ -102,9 +102,9 @@ where
R: ExpressionResultType,
{
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- f.debug_struct("Expression")
- .field("index", &self.index)
- .finish()
+ let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) };
+ let t = unsafe { LowLevelILExpressionKind::from_raw(self.function, op) };
+ t.fmt(f)
}
}
diff --git a/rust/src/low_level_il/function.rs b/rust/src/low_level_il/function.rs
index 85037632..301c3f09 100644
--- a/rust/src/low_level_il/function.rs
+++ b/rust/src/low_level_il/function.rs
@@ -35,7 +35,7 @@ pub struct Mutable;
#[derive(Copy, Clone, Debug)]
pub struct Finalized;
-pub trait FunctionMutability: 'static {}
+pub trait FunctionMutability: 'static + Debug {}
impl FunctionMutability for Mutable {}
impl FunctionMutability for Finalized {}
@@ -44,7 +44,7 @@ pub struct LiftedNonSSA;
#[derive(Copy, Clone, Debug)]
pub struct RegularNonSSA;
-pub trait NonSSAVariant: 'static {}
+pub trait NonSSAVariant: 'static + Debug {}
impl NonSSAVariant for LiftedNonSSA {}
impl NonSSAVariant for RegularNonSSA {}
@@ -53,7 +53,7 @@ pub struct SSA;
#[derive(Copy, Clone, Debug)]
pub struct NonSSA<V: NonSSAVariant>(V);
-pub trait FunctionForm: 'static {}
+pub trait FunctionForm: 'static + Debug {}
impl FunctionForm for SSA {}
impl<V: NonSSAVariant> FunctionForm for NonSSA<V> {}