pub enum VariableNodeType {
ReferenceOffset(UnitOffset),
TypeOffset(UnitOffset),
DirectLookup,
DoNotRecurse,
RecurseToBaseType,
SvdPeripheral,
SvdRegister,
SvdField,
}
Expand description
Variants
ReferenceOffset(UnitOffset)
For pointer values, their referenced variables are found at an gimli::UnitOffset in the DebugInfo.
- Rule: Pointers to
struct
variables WILL NOT BE recursed, because this may lead to infinite loops/stack overflows instruct
s that self-reference. - Rule: Pointers to “base” datatypes SHOULD BE, but ARE NOT resolved, because it would keep the UX simple, but DWARF doesn’t make it easy to determine when a pointer points to a base data type. We can read ahead in the DIE children, but that feels rather inefficient.
TypeOffset(UnitOffset)
Use the header_offset
and type_offset
as direct references for recursing the variable children. With the current implementation, the type_offset
will point to a DIE with a tag of DW_TAG_structure_type
.
- Rule: For structured variables, we WILL NOT automatically expand their children, but we have enough information to expand it on demand. Except if they fall into one of the special cases handled by [VariableNodeType::RecurseAsIntermediate]
DirectLookup
Use the header_offset
and entries_offset
as direct references for recursing the variable children.
- Rule: All top level variables in a StackFrame are automatically deferred, i.e [VariableName::StaticScope], [VariableName::Registers], [VariableName::LocalScope].
DoNotRecurse
Sometimes it doesn’t make sense to recurse the children of a specific node type
- Rule: Pointers to
unit
datatypes WILL NOT BE resolved, because it doesn’t make sense. - Rule: Once we determine that a variable can not be recursed further, we update the variable_node_type to indicate that no further recursion is possible/required. This can be because the variable is a ‘base’ data type, or because there was some kind of error in processing the current node, so we don’t want to incur cascading errors. TODO: Find code instances where we use magic values (e.g. u32::MAX) and replace with DoNotRecurse logic if appropriate.
RecurseToBaseType
Unless otherwise specified, always recurse the children of every node until we get to the base data type.
- Rule: (Default) Unless it is prevented by any of the other rules, we always recurse the children of these variables.
- Rule: Certain structured variables (e.g.
&str
,Some
,Ok
,Err
, etc.) are set to VariableNodeType::RecurseToBaseType to improve the debugger UX. - Rule: Pointers to
const
variables WILL ALWAYS BE recursed, because they provide essential information, for example about the length of strings, or the size of arrays. - Rule: Enumerated types WILL ALWAYS BE recursed, because we only ever want to see the ‘active’ child as the value.
- Rule: For now, Array types WILL ALWAYS BE recursed. TODO: Evaluate if it is beneficial to defer these.
- Rule: For now, Union types WILL ALWAYS BE recursed. TODO: Evaluate if it is beneficial to defer these.
SvdPeripheral
SVD Device Peripherals
SvdRegister
SVD Peripheral Registers
SvdField
SVD Register Fields
Implementations
sourceimpl VariableNodeType
impl VariableNodeType
sourcepub fn is_deferred(&self) -> bool
pub fn is_deferred(&self) -> bool
Will return true if any of the variable_node_type
value implies that the variable will be ‘lazy’ resolved.
Trait Implementations
sourceimpl Clone for VariableNodeType
impl Clone for VariableNodeType
sourcefn clone(&self) -> VariableNodeType
fn clone(&self) -> VariableNodeType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for VariableNodeType
impl Debug for VariableNodeType
sourceimpl Default for VariableNodeType
impl Default for VariableNodeType
sourceimpl PartialEq<VariableNodeType> for VariableNodeType
impl PartialEq<VariableNodeType> for VariableNodeType
sourcefn eq(&self, other: &VariableNodeType) -> bool
fn eq(&self, other: &VariableNodeType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VariableNodeType) -> bool
fn ne(&self, other: &VariableNodeType) -> bool
This method tests for !=
.
impl StructuralPartialEq for VariableNodeType
Auto Trait Implementations
impl RefUnwindSafe for VariableNodeType
impl Send for VariableNodeType
impl Sync for VariableNodeType
impl Unpin for VariableNodeType
impl UnwindSafe for VariableNodeType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more