From 0800529fe605a03e9da1aca241a377eebcaa8cad Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 29 May 2020 22:10:05 -0700 Subject: [lldb/Bindings] Raise exception when using properties that rely on lldb.target Several SBAddress properties use the lldb.target or lldb.process convenience variables which are only set under the interactive script interpreter. Unfortunately, users have been using these properties in Python script and commands. This patch raises a Python exception to force users to use GetLoadAddress instead. Differential revision: https://reviews.llvm.org/D80848 --- lldb/test/Shell/ScriptInterpreter/Python/Inputs/sbaddress.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lldb/test/Shell/ScriptInterpreter/Python/Inputs/sbaddress.py (limited to 'lldb/test/Shell/ScriptInterpreter/Python/Inputs') diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Inputs/sbaddress.py b/lldb/test/Shell/ScriptInterpreter/Python/Inputs/sbaddress.py new file mode 100644 index 0000000..132d284 --- /dev/null +++ b/lldb/test/Shell/ScriptInterpreter/Python/Inputs/sbaddress.py @@ -0,0 +1,7 @@ +import lldb + +def test(debugger, command, result, internal_dict): + return int(lldb.SBAddress()) + +def __lldb_init_module(debugger, internal_dict): + debugger.HandleCommand('command script add -f sbaddress.test test') -- cgit v1.1