Files
clang-p2996/lldb/test/functionalities/conditional_break/conditional_break.py
Greg Clayton 44d937820b Merging the iohandler branch back into main.
The many many benefits include:
1 - Input/Output/Error streams are now handled as real streams not a push style input
2 - auto completion in python embedded interpreter
3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use
4 - it is now possible to use curses to drive LLDB (please try the "gui" command)

We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases.

llvm-svn: 200263
2014-01-27 23:43:24 +00:00

31 lines
809 B
Python

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