Skip to content

[lldb] Support CommandInterpreter print callbacks #9955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/bindings/python/python-swigsafecast.swig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBValue> value_sb)
return ToSWIGHelper(value_sb.release(), SWIGTYPE_p_lldb__SBValue);
}

PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBCommandReturnObject> result_up) {
return ToSWIGHelper(result_up.release(), SWIGTYPE_p_lldb__SBCommandReturnObject);
}

PythonObject SWIGBridge::ToSWIGWrapper(lldb::ValueObjectSP value_sp) {
return ToSWIGWrapper(std::unique_ptr<lldb::SBValue>(new lldb::SBValue(value_sp)));
}
Expand Down
19 changes: 19 additions & 0 deletions lldb/bindings/python/python-typemaps.swig
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,25 @@ template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
$1 = $1 || PyCallable_Check(reinterpret_cast<PyObject *>($input));
}

// For lldb::SBCommandPrintCallback
%typemap(in) (lldb::SBCommandPrintCallback callback, void *baton) {
if (!($input == Py_None ||
PyCallable_Check(reinterpret_cast<PyObject *>($input)))) {
PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
SWIG_fail;
}

// Don't lose the callback reference.
Py_INCREF($input);
$1 = LLDBSwigPythonCallPythonCommandPrintCallback;
$2 = $input;
}

%typemap(typecheck) (lldb::SBCommandPrintCallback callback, void *baton) {
$1 = $input == Py_None;
$1 = $1 || PyCallable_Check(reinterpret_cast<PyObject *>($input));
}

%typemap(in) (lldb::CommandOverrideCallback callback, void *baton) {
if (!($input == Py_None ||
PyCallable_Check(reinterpret_cast<PyObject *>($input)))) {
Expand Down
22 changes: 21 additions & 1 deletion lldb/bindings/python/python-wrapper.swig
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallParsedCommandObject(
auto pfunc = self.ResolveName<PythonCallable>("__call__");

if (!pfunc.IsAllocated()) {
cmd_retobj.AppendError("Could not find '__call__' method in implementation class");
cmd_retobj.AppendError("Could not find '__call__' method in implementation class");
return false;
}

Expand Down Expand Up @@ -1024,6 +1024,26 @@ static void LLDBSwigPythonCallPythonLogOutputCallback(const char *str,
}
}

// For CommandPrintCallback functions
static CommandReturnObjectCallbackResult LLDBSwigPythonCallPythonCommandPrintCallback(SBCommandReturnObject& result, void *callback_baton) {
SWIG_Python_Thread_Block swig_thread_block;

PyErr_Cleaner py_err_cleaner(true);

PythonObject result_arg = SWIGBridge::ToSWIGWrapper(
std::make_unique<SBCommandReturnObject>(result));
PythonCallable callable =
Retain<PythonCallable>(reinterpret_cast<PyObject *>(callback_baton));

if (!callable.IsValid())
return eCommandReturnObjectPrintCallbackSkipped;

PythonObject callback_result = callable(result_arg);

long long ret_val = unwrapOrSetPythonException(As<long long>(callback_result));
return (CommandReturnObjectCallbackResult)ret_val;
}

// For DebuggerTerminateCallback functions
static void LLDBSwigPythonCallPythonSBDebuggerTerminateCallback(lldb::user_id_t debugger_id,
void *baton) {
Expand Down
151 changes: 150 additions & 1 deletion lldb/bindings/python/static-binding/LLDBWrapPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5652,7 +5652,7 @@ bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallParsedCommandObject(
auto pfunc = self.ResolveName<PythonCallable>("__call__");

if (!pfunc.IsAllocated()) {
cmd_retobj.AppendError("Could not find '__call__' method in implementation class");
cmd_retobj.AppendError("Could not find '__call__' method in implementation class");
return false;
}

Expand Down Expand Up @@ -5911,6 +5911,26 @@ static void LLDBSwigPythonCallPythonLogOutputCallback(const char *str,
}
}

// For CommandPrintCallback functions
static CommandReturnObjectCallbackResult LLDBSwigPythonCallPythonCommandPrintCallback(SBCommandReturnObject& result, void *callback_baton) {
SWIG_Python_Thread_Block swig_thread_block;

PyErr_Cleaner py_err_cleaner(true);

PythonObject result_arg = SWIGBridge::ToSWIGWrapper(
std::make_unique<SBCommandReturnObject>(result));
PythonCallable callable =
Retain<PythonCallable>(reinterpret_cast<PyObject *>(callback_baton));

if (!callable.IsValid())
return eCommandReturnObjectPrintCallbackSkipped;

PythonObject callback_result = callable(result_arg);

long long ret_val = unwrapOrSetPythonException(As<long long>(callback_result));
return (CommandReturnObjectCallbackResult)ret_val;
}

// For DebuggerTerminateCallback functions
static void LLDBSwigPythonCallPythonSBDebuggerTerminateCallback(lldb::user_id_t debugger_id,
void *baton) {
Expand Down Expand Up @@ -17699,6 +17719,46 @@ SWIGINTERN PyObject *_wrap_SBCommandInterpreter_GetTranscript(PyObject *self, Py
}


SWIGINTERN PyObject *_wrap_SBCommandInterpreter_SetPrintCallback(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ;
lldb::SBCommandPrintCallback arg2 = (lldb::SBCommandPrintCallback) 0 ;
void *arg3 = (void *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[2] ;

(void)self;
if (!SWIG_Python_UnpackTuple(args, "SBCommandInterpreter_SetPrintCallback", 2, 2, swig_obj)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBCommandInterpreter, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBCommandInterpreter_SetPrintCallback" "', argument " "1"" of type '" "lldb::SBCommandInterpreter *""'");
}
arg1 = reinterpret_cast< lldb::SBCommandInterpreter * >(argp1);
{
if (!(swig_obj[1] == Py_None ||
PyCallable_Check(reinterpret_cast<PyObject *>(swig_obj[1])))) {
PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
SWIG_fail;
}

// Don't lose the callback reference.
Py_INCREF(swig_obj[1]);
arg2 = LLDBSwigPythonCallPythonCommandPrintCallback;
arg3 = swig_obj[1];
}
{
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
(arg1)->SetPrintCallback(arg2,arg3);
SWIG_PYTHON_THREAD_END_ALLOW;
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}


SWIGINTERN PyObject *SBCommandInterpreter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj = NULL;
if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
Expand Down Expand Up @@ -18665,6 +18725,34 @@ SWIGINTERN PyObject *_wrap_SBCommandReturnObject_IsValid(PyObject *self, PyObjec
}


SWIGINTERN PyObject *_wrap_SBCommandReturnObject_GetCommand(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
char *result = 0 ;

(void)self;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBCommandReturnObject, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBCommandReturnObject_GetCommand" "', argument " "1"" of type '" "lldb::SBCommandReturnObject *""'");
}
arg1 = reinterpret_cast< lldb::SBCommandReturnObject * >(argp1);
{
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
result = (char *)(arg1)->GetCommand();
SWIG_PYTHON_THREAD_END_ALLOW;
}
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
return NULL;
}


SWIGINTERN PyObject *_wrap_SBCommandReturnObject_GetOutput__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
PyObject *resultobj = 0;
lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ;
Expand Down Expand Up @@ -29195,6 +29283,33 @@ SWIGINTERN PyObject *_wrap_SBDebugger_GetSyntheticForType(PyObject *self, PyObje
}


SWIGINTERN PyObject *_wrap_SBDebugger_ResetStatistics(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;

(void)self;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBDebugger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBDebugger_ResetStatistics" "', argument " "1"" of type '" "lldb::SBDebugger *""'");
}
arg1 = reinterpret_cast< lldb::SBDebugger * >(argp1);
{
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
(arg1)->ResetStatistics();
SWIG_PYTHON_THREAD_END_ALLOW;
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}


SWIGINTERN PyObject *_wrap_SBDebugger_RunCommandInterpreter(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ;
Expand Down Expand Up @@ -65557,6 +65672,33 @@ SWIGINTERN PyObject *_wrap_SBTarget_GetStatistics(PyObject *self, PyObject *args
}


SWIGINTERN PyObject *_wrap_SBTarget_ResetStatistics(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;

(void)self;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBTarget, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBTarget_ResetStatistics" "', argument " "1"" of type '" "lldb::SBTarget *""'");
}
arg1 = reinterpret_cast< lldb::SBTarget * >(argp1);
{
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
(arg1)->ResetStatistics();
SWIG_PYTHON_THREAD_END_ALLOW;
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}


SWIGINTERN PyObject *_wrap_SBTarget_GetPlatform(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ;
Expand Down Expand Up @@ -96323,6 +96465,7 @@ static PyMethodDef SwigMethods[] = {
{ "SBCommandInterpreter_ResolveCommand", _wrap_SBCommandInterpreter_ResolveCommand, METH_VARARGS, "SBCommandInterpreter_ResolveCommand(SBCommandInterpreter self, char const * command_line, SBCommandReturnObject result)"},
{ "SBCommandInterpreter_GetStatistics", _wrap_SBCommandInterpreter_GetStatistics, METH_O, "SBCommandInterpreter_GetStatistics(SBCommandInterpreter self) -> SBStructuredData"},
{ "SBCommandInterpreter_GetTranscript", _wrap_SBCommandInterpreter_GetTranscript, METH_O, "SBCommandInterpreter_GetTranscript(SBCommandInterpreter self) -> SBStructuredData"},
{ "SBCommandInterpreter_SetPrintCallback", _wrap_SBCommandInterpreter_SetPrintCallback, METH_VARARGS, "SBCommandInterpreter_SetPrintCallback(SBCommandInterpreter self, lldb::SBCommandPrintCallback callback)"},
{ "SBCommandInterpreter_swigregister", SBCommandInterpreter_swigregister, METH_O, NULL},
{ "SBCommandInterpreter_swiginit", SBCommandInterpreter_swiginit, METH_VARARGS, NULL},
{ "new_SBCommandInterpreterRunOptions", _wrap_new_SBCommandInterpreterRunOptions, METH_VARARGS, "\n"
Expand Down Expand Up @@ -96361,6 +96504,7 @@ static PyMethodDef SwigMethods[] = {
{ "delete_SBCommandReturnObject", _wrap_delete_SBCommandReturnObject, METH_O, "delete_SBCommandReturnObject(SBCommandReturnObject self)"},
{ "SBCommandReturnObject___nonzero__", _wrap_SBCommandReturnObject___nonzero__, METH_O, "SBCommandReturnObject___nonzero__(SBCommandReturnObject self) -> bool"},
{ "SBCommandReturnObject_IsValid", _wrap_SBCommandReturnObject_IsValid, METH_O, "SBCommandReturnObject_IsValid(SBCommandReturnObject self) -> bool"},
{ "SBCommandReturnObject_GetCommand", _wrap_SBCommandReturnObject_GetCommand, METH_O, "SBCommandReturnObject_GetCommand(SBCommandReturnObject self) -> char const *"},
{ "SBCommandReturnObject_GetErrorData", _wrap_SBCommandReturnObject_GetErrorData, METH_O, "SBCommandReturnObject_GetErrorData(SBCommandReturnObject self) -> SBStructuredData"},
{ "SBCommandReturnObject_PutOutput", _wrap_SBCommandReturnObject_PutOutput, METH_VARARGS, "\n"
"SBCommandReturnObject_PutOutput(SBCommandReturnObject self, SBFile file) -> size_t\n"
Expand Down Expand Up @@ -96712,6 +96856,7 @@ static PyMethodDef SwigMethods[] = {
{ "SBDebugger_GetSummaryForType", _wrap_SBDebugger_GetSummaryForType, METH_VARARGS, "SBDebugger_GetSummaryForType(SBDebugger self, SBTypeNameSpecifier arg2) -> SBTypeSummary"},
{ "SBDebugger_GetFilterForType", _wrap_SBDebugger_GetFilterForType, METH_VARARGS, "SBDebugger_GetFilterForType(SBDebugger self, SBTypeNameSpecifier arg2) -> SBTypeFilter"},
{ "SBDebugger_GetSyntheticForType", _wrap_SBDebugger_GetSyntheticForType, METH_VARARGS, "SBDebugger_GetSyntheticForType(SBDebugger self, SBTypeNameSpecifier arg2) -> SBTypeSynthetic"},
{ "SBDebugger_ResetStatistics", _wrap_SBDebugger_ResetStatistics, METH_O, "SBDebugger_ResetStatistics(SBDebugger self)"},
{ "SBDebugger_RunCommandInterpreter", _wrap_SBDebugger_RunCommandInterpreter, METH_VARARGS, "\n"
"SBDebugger_RunCommandInterpreter(SBDebugger self, bool auto_handle_events, bool spawn_thread, SBCommandInterpreterRunOptions options, int & num_errors, bool & quit_requested, bool & stopped_for_crash)\n"
"Launch a command interpreter session. Commands are read from standard input or\n"
Expand Down Expand Up @@ -98526,6 +98671,7 @@ static PyMethodDef SwigMethods[] = {
"SBTarget_GetStatistics(SBTarget self) -> SBStructuredData\n"
"SBTarget_GetStatistics(SBTarget self, SBStatisticsOptions options) -> SBStructuredData\n"
""},
{ "SBTarget_ResetStatistics", _wrap_SBTarget_ResetStatistics, METH_O, "SBTarget_ResetStatistics(SBTarget self)"},
{ "SBTarget_GetPlatform", _wrap_SBTarget_GetPlatform, METH_O, "\n"
"SBTarget_GetPlatform(SBTarget self) -> SBPlatform\n"
"\n"
Expand Down Expand Up @@ -102876,6 +103022,7 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "eSectionTypeDWARFDebugTuIndex",SWIG_From_int(static_cast< int >(lldb::eSectionTypeDWARFDebugTuIndex)));
SWIG_Python_SetConstant(d, "eSectionTypeCTF",SWIG_From_int(static_cast< int >(lldb::eSectionTypeCTF)));
SWIG_Python_SetConstant(d, "eSectionTypeLLDBTypeSummaries",SWIG_From_int(static_cast< int >(lldb::eSectionTypeLLDBTypeSummaries)));
SWIG_Python_SetConstant(d, "eSectionTypeLLDBFormatters",SWIG_From_int(static_cast< int >(lldb::eSectionTypeLLDBFormatters)));
SWIG_Python_SetConstant(d, "eSectionTypeSwiftModules",SWIG_From_int(static_cast< int >(lldb::eSectionTypeSwiftModules)));
SWIG_Python_SetConstant(d, "eEmulateInstructionOptionNone",SWIG_From_int(static_cast< int >(lldb::eEmulateInstructionOptionNone)));
SWIG_Python_SetConstant(d, "eEmulateInstructionOptionAutoAdvancePC",SWIG_From_int(static_cast< int >(lldb::eEmulateInstructionOptionAutoAdvancePC)));
Expand Down Expand Up @@ -103180,6 +103327,8 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "eSeverityError",SWIG_From_int(static_cast< int >(lldb::eSeverityError)));
SWIG_Python_SetConstant(d, "eSeverityWarning",SWIG_From_int(static_cast< int >(lldb::eSeverityWarning)));
SWIG_Python_SetConstant(d, "eSeverityInfo",SWIG_From_int(static_cast< int >(lldb::eSeverityInfo)));
SWIG_Python_SetConstant(d, "eCommandReturnObjectPrintCallbackSkipped",SWIG_From_int(static_cast< int >(lldb::eCommandReturnObjectPrintCallbackSkipped)));
SWIG_Python_SetConstant(d, "eCommandReturnObjectPrintCallbackHandled",SWIG_From_int(static_cast< int >(lldb::eCommandReturnObjectPrintCallbackHandled)));
SWIG_Python_SetConstant(d, "SBCommandInterpreter_eBroadcastBitThreadShouldExit",SWIG_From_int(static_cast< int >(lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit)));
SWIG_Python_SetConstant(d, "SBCommandInterpreter_eBroadcastBitResetPrompt",SWIG_From_int(static_cast< int >(lldb::SBCommandInterpreter::eBroadcastBitResetPrompt)));
SWIG_Python_SetConstant(d, "SBCommandInterpreter_eBroadcastBitQuitCommandReceived",SWIG_From_int(static_cast< int >(lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived)));
Expand Down
22 changes: 22 additions & 0 deletions lldb/bindings/python/static-binding/lldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,8 @@ def lldb_iter(obj, getsize, getelem):

eSectionTypeLLDBTypeSummaries = _lldb.eSectionTypeLLDBTypeSummaries

eSectionTypeLLDBFormatters = _lldb.eSectionTypeLLDBFormatters

eSectionTypeSwiftModules = _lldb.eSectionTypeSwiftModules

eEmulateInstructionOptionNone = _lldb.eEmulateInstructionOptionNone
Expand Down Expand Up @@ -1817,6 +1819,10 @@ def lldb_iter(obj, getsize, getelem):

eSeverityInfo = _lldb.eSeverityInfo

eCommandReturnObjectPrintCallbackSkipped = _lldb.eCommandReturnObjectPrintCallbackSkipped

eCommandReturnObjectPrintCallbackHandled = _lldb.eCommandReturnObjectPrintCallbackHandled

class SBAddress(object):
r"""
A section + offset based address class.
Expand Down Expand Up @@ -3609,6 +3615,10 @@ def GetTranscript(self):
r"""GetTranscript(SBCommandInterpreter self) -> SBStructuredData"""
return _lldb.SBCommandInterpreter_GetTranscript(self)

def SetPrintCallback(self, callback):
r"""SetPrintCallback(SBCommandInterpreter self, lldb::SBCommandPrintCallback callback)"""
return _lldb.SBCommandInterpreter_SetPrintCallback(self, callback)

# Register SBCommandInterpreter in _lldb:
_lldb.SBCommandInterpreter_swigregister(SBCommandInterpreter)
class SBCommandInterpreterRunOptions(object):
Expand Down Expand Up @@ -3761,6 +3771,10 @@ def IsValid(self):
r"""IsValid(SBCommandReturnObject self) -> bool"""
return _lldb.SBCommandReturnObject_IsValid(self)

def GetCommand(self):
r"""GetCommand(SBCommandReturnObject self) -> char const *"""
return _lldb.SBCommandReturnObject_GetCommand(self)

def GetErrorData(self):
r"""GetErrorData(SBCommandReturnObject self) -> SBStructuredData"""
return _lldb.SBCommandReturnObject_GetErrorData(self)
Expand Down Expand Up @@ -5187,6 +5201,10 @@ def GetSyntheticForType(self, arg2):
r"""GetSyntheticForType(SBDebugger self, SBTypeNameSpecifier arg2) -> SBTypeSynthetic"""
return _lldb.SBDebugger_GetSyntheticForType(self, arg2)

def ResetStatistics(self):
r"""ResetStatistics(SBDebugger self)"""
return _lldb.SBDebugger_ResetStatistics(self)

def RunCommandInterpreter(self, auto_handle_events, spawn_thread, options, num_errors, quit_requested, stopped_for_crash):
r"""
RunCommandInterpreter(SBDebugger self, bool auto_handle_events, bool spawn_thread, SBCommandInterpreterRunOptions options, int & num_errors, bool & quit_requested, bool & stopped_for_crash)
Expand Down Expand Up @@ -11243,6 +11261,10 @@ def GetStatistics(self, *args):
"""
return _lldb.SBTarget_GetStatistics(self, *args)

def ResetStatistics(self):
r"""ResetStatistics(SBTarget self)"""
return _lldb.SBTarget_ResetStatistics(self)

def GetPlatform(self):
r"""
GetPlatform(SBTarget self) -> SBPlatform
Expand Down
8 changes: 5 additions & 3 deletions lldb/include/lldb/API/SBCommandInterpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ class SBCommandInterpreter {
lldb::SBStringList &matches,
lldb::SBStringList &descriptions);

/// Returns whether an interrupt flag was raised either by the SBDebugger -
/// Returns whether an interrupt flag was raised either by the SBDebugger -
/// when the function is not running on the RunCommandInterpreter thread, or
/// by SBCommandInterpreter::InterruptCommand if it is. If your code is doing
/// interruptible work, check this API periodically, and interrupt if it
/// interruptible work, check this API periodically, and interrupt if it
/// returns true.
bool WasInterrupted() const;

/// Interrupts the command currently executing in the RunCommandInterpreter
/// thread.
///
Expand Down Expand Up @@ -331,6 +331,8 @@ class SBCommandInterpreter {
/// this list. Otherwise this list is empty.
SBStructuredData GetTranscript();

void SetPrintCallback(lldb::SBCommandPrintCallback callback, void *baton);

protected:
friend class lldb_private::CommandPluginInterfaceImplementation;

Expand Down
Loading