pub struct Variable<'a> { /* private fields */ }
Expand description
This class represents a DWARF variable which can be owned by a
crate::dwarf::Function
or a crate::dwarf::CompilationUnit
Implementations§
§impl Variable<'_>
impl Variable<'_>
pub fn linkage_name(&self) -> Option<String>
pub fn linkage_name(&self) -> Option<String>
The name of the variable which is used for linking (DW_AT_linkage_name
).
This name differs from Variable::name
as it is usually mangled.
pub fn address(&self) -> Result<i64, Error>
pub fn address(&self) -> Result<i64, Error>
Address of the variable.
If the variable is static, it returns the virtual address where it is defined. If the variable is stack-based, it returns the relative offset from the frame based register.
If the address can’t be resolved, it returns an Error
.
pub fn size(&self) -> Result<u64, Error>
pub fn size(&self) -> Result<u64, Error>
Return the size of the variable (or an Error
if it can’t be
resolved).
This size is defined by its type.
pub fn is_constexpr(&self) -> bool
pub fn is_constexpr(&self) -> bool
Whether it’s a constexpr
variable
pub fn is_stack_based(&self) -> bool
pub fn is_stack_based(&self) -> bool
Whether this variable is allocated on the stack
pub fn debug_location(&self) -> DebugLocation
pub fn debug_location(&self) -> DebugLocation
The original source location where the variable is defined.
pub fn description(&self) -> String
pub fn description(&self) -> String
Description (DW_AT_description
) of the variable or an empty string