summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-11-22 15:43:39 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-11-22 15:43:39 -0800
commitb6ae524cd2d5139748e207d4b60b4a900775d6a7 (patch)
treec25d8c4871c6fc27bfdce774782b262238988469 /lldb/examples/python
parent1b099c1df00e3c8a0ba20af199c89a154bdb7a45 (diff)
downloadbcm5719-llvm-b6ae524cd2d5139748e207d4b60b4a900775d6a7.tar.gz
bcm5719-llvm-b6ae524cd2d5139748e207d4b60b4a900775d6a7.zip
[Examples] Move structured-data unpacking out of the loop. (NFC)
There's no need to repeat this work in the loop.
Diffstat (limited to 'lldb/examples/python')
-rwxr-xr-xlldb/examples/python/in_call_stack.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/examples/python/in_call_stack.py b/lldb/examples/python/in_call_stack.py
index ba3ca57267f..0647f2ca342 100755
--- a/lldb/examples/python/in_call_stack.py
+++ b/lldb/examples/python/in_call_stack.py
@@ -9,10 +9,10 @@ def __lldb_init_module(debugger, internal_dict):
def in_call_stack(frame, bp_loc, arg_dict, _):
"""Only break if the given name is in the current call stack."""
+ name = arg_dict.GetValueForKey('name').GetStringValue(1000)
thread = frame.GetThread()
found = False
for frame in thread.frames:
- name = arg_dict.GetValueForKey('name').GetStringValue(1000)
# Check the symbol.
symbol = frame.GetSymbol()
if symbol and name in frame.GetSymbol().GetName():
OpenPOWER on IntegriCloud