diff options
Diffstat (limited to 'python/variable.py')
| -rw-r--r-- | python/variable.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/variable.py b/python/variable.py index 07b8863c..839e87ce 100644 --- a/python/variable.py +++ b/python/variable.py @@ -663,7 +663,7 @@ class Variable(CoreVariable): if self.type is not None: return f"<var {self.type.get_string_before_name()} {self.name}{self.type.get_string_after_name()}>" else: - return repr(super()) + return f"<var {self.name}>" def __str__(self): return self.name @@ -712,7 +712,7 @@ class Variable(CoreVariable): @property def name(self) -> str: """Name of the variable, Settings thisslow because it ensures that analysis has been updated. """ - return core.BNGetRealVariableName(self._function.handle, self._function.arch.handle, self.to_BNVariable()) + return core.BNGetVariableNameOrDefault(self._function.handle, self.to_BNVariable()) @name.setter def name(self, name: Optional[str]) -> None: @@ -720,6 +720,11 @@ class Variable(CoreVariable): self._function.view.update_analysis_and_wait() @property + def last_seen_name(self) -> str: + """Name of the variable, or the name most recently assigned if the variable has since been removed (read-only). """ + return core.BNGetLastSeenVariableNameOrDefault(self._function.handle, self.to_BNVariable()) + + @property def type(self) -> Optional['binaryninja.types.Type']: var_type_conf = core.BNGetVariableType(self._function.handle, self.to_BNVariable()) if var_type_conf.type: |
