OSDN Git Service

[lldb/Bindings] Raise exception when using properties that rely on lldb.target
authorJonas Devlieghere <jonas@devlieghere.com>
Sat, 30 May 2020 05:10:05 +0000 (22:10 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Sat, 30 May 2020 05:11:21 +0000 (22:11 -0700)
commit0800529fe605a03e9da1aca241a377eebcaa8cad
tree6f580a44acb04ce281d7c2594fee38dde2df86f5
parent21fee0921d563f407e07b5e28592c2925da3704d
[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/bindings/interface/SBAddress.i
lldb/test/Shell/ScriptInterpreter/Python/Inputs/sbaddress.py [new file with mode: 0644]
lldb/test/Shell/ScriptInterpreter/Python/sb_address_exception.test [new file with mode: 0644]