From 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 6 Jan 2016 20:12:03 +0000 Subject: Vendor import of lldb trunk r256945: https://llvm.org/svn/llvm-project/lldb/trunk@256945 --- .../conditional_break/conditional_break.py | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/Python/lldbsuite/test/functionalities/conditional_break/conditional_break.py (limited to 'packages/Python/lldbsuite/test/functionalities/conditional_break/conditional_break.py') diff --git a/packages/Python/lldbsuite/test/functionalities/conditional_break/conditional_break.py b/packages/Python/lldbsuite/test/functionalities/conditional_break/conditional_break.py new file mode 100644 index 000000000000..b30a34e56b14 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/conditional_break/conditional_break.py @@ -0,0 +1,30 @@ +import sys +import lldb + +def stop_if_called_from_a(frame, bp_loc, dict): + + thread = frame.GetThread() + process = thread.GetProcess() + target = process.GetTarget() + dbg = target.GetDebugger() + + # Perform synchronous interaction with the debugger. + old_async = dbg.GetAsync() + dbg.SetAsync(True) + + # We check the call frames in order to stop only when the immediate caller + # of the leaf function c() is a(). If it's not the right caller, we ask the + # command interpreter to continue execution. + + should_stop = True + if thread.GetNumFrames() >= 2: + + if (thread.frames[0].function.name == 'c' and thread.frames[1].function.name == 'a'): + should_stop = True + else: + should_stop = False + + dbg.SetAsync(old_async) + return should_stop + + -- cgit v1.2.3