diff --git a/pwndbg/dbg/lldb/__init__.py b/pwndbg/dbg/lldb/__init__.py index 7845baf15..8b574734d 100644 --- a/pwndbg/dbg/lldb/__init__.py +++ b/pwndbg/dbg/lldb/__init__.py @@ -1405,7 +1405,11 @@ class LLDBProcess(pwndbg.dbg_mod.Process): variables_types: Dict[Tuple[int, str], LLDBType] = {} if type in (pwndbg.dbg_mod.SymbolLookupType.VARIABLE, pwndbg.dbg_mod.SymbolLookupType.ANY): - variables: lldb.SBValueList = (objfile or self.target).FindGlobalVariables(name, 0) + variables: lldb.SBValueList + if objfile: + variables = objfile.FindGlobalVariables(self.target, name, 0) + else: + variables = self.target.FindGlobalVariables(name, 0) var: lldb.SBValue for var in variables: # LLDB[1] is attempting to resolve a TLS variable, but it fails with the following error: