@@ -5947,6 +5947,28 @@ static void LLDBSwigPythonCallPythonSBDebuggerTerminateCallback(lldb::user_id_t
5947
5947
}
5948
5948
}
5949
5949
5950
+ static bool LLDBSwigPythonCallPythonSBCommandInterpreterSetCommandOverrideCallback(void *baton, const char **argv) {
5951
+ bool ret_val = false;
5952
+ if (baton != Py_None) {
5953
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
5954
+ // Create a PyList of items since we're going to pass it to the callback as a tuple
5955
+ // of arguments.
5956
+ PyObject *py_argv = PyList_New(0);
5957
+ for (const char **arg = argv; arg && *arg; arg++) {
5958
+ std::string arg_string = *arg;
5959
+ PyObject *py_string = PyUnicode_FromStringAndSize(arg_string.c_str(), arg_string.size());
5960
+ PyList_Append(py_argv, py_string);
5961
+ }
5962
+
5963
+ PyObject *result = PyObject_CallObject(
5964
+ reinterpret_cast<PyObject *>(baton), PyList_AsTuple(py_argv));
5965
+ ret_val = result ? PyObject_IsTrue(result) : false;
5966
+ Py_XDECREF(result);
5967
+ SWIG_PYTHON_THREAD_END_BLOCK;
5968
+ }
5969
+ return ret_val;
5970
+ }
5971
+
5950
5972
static SBError LLDBSwigPythonCallLocateModuleCallback(
5951
5973
void *callback_baton, const SBModuleSpec &module_spec_sb,
5952
5974
SBFileSpec &module_file_spec_sb, SBFileSpec &symbol_file_spec_sb) {
@@ -16511,6 +16533,58 @@ SWIGINTERN PyObject *_wrap_SBCommandInterpreter_InterruptCommand(PyObject *self,
16511
16533
}
16512
16534
16513
16535
16536
+ SWIGINTERN PyObject *_wrap_SBCommandInterpreter_SetCommandOverrideCallback(PyObject *self, PyObject *args) {
16537
+ PyObject *resultobj = 0;
16538
+ lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ;
16539
+ char *arg2 = (char *) 0 ;
16540
+ lldb::CommandOverrideCallback arg3 = (lldb::CommandOverrideCallback) 0 ;
16541
+ void *arg4 = (void *) 0 ;
16542
+ void *argp1 = 0 ;
16543
+ int res1 = 0 ;
16544
+ int res2 ;
16545
+ char *buf2 = 0 ;
16546
+ int alloc2 = 0 ;
16547
+ PyObject *swig_obj[3] ;
16548
+ bool result;
16549
+
16550
+ (void)self;
16551
+ if (!SWIG_Python_UnpackTuple(args, "SBCommandInterpreter_SetCommandOverrideCallback", 3, 3, swig_obj)) SWIG_fail;
16552
+ res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBCommandInterpreter, 0 | 0 );
16553
+ if (!SWIG_IsOK(res1)) {
16554
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBCommandInterpreter_SetCommandOverrideCallback" "', argument " "1"" of type '" "lldb::SBCommandInterpreter *""'");
16555
+ }
16556
+ arg1 = reinterpret_cast< lldb::SBCommandInterpreter * >(argp1);
16557
+ res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
16558
+ if (!SWIG_IsOK(res2)) {
16559
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SBCommandInterpreter_SetCommandOverrideCallback" "', argument " "2"" of type '" "char const *""'");
16560
+ }
16561
+ arg2 = reinterpret_cast< char * >(buf2);
16562
+ {
16563
+ if (!(swig_obj[2] == Py_None ||
16564
+ PyCallable_Check(reinterpret_cast<PyObject *>(swig_obj[2])))) {
16565
+ PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
16566
+ SWIG_fail;
16567
+ }
16568
+
16569
+ // Don't lose the callback reference.
16570
+ Py_INCREF(swig_obj[2]);
16571
+ arg3 = LLDBSwigPythonCallPythonSBCommandInterpreterSetCommandOverrideCallback;
16572
+ arg4 = swig_obj[2];
16573
+ }
16574
+ {
16575
+ SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16576
+ result = (bool)(arg1)->SetCommandOverrideCallback((char const *)arg2,arg3,arg4);
16577
+ SWIG_PYTHON_THREAD_END_ALLOW;
16578
+ }
16579
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
16580
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16581
+ return resultobj;
16582
+ fail:
16583
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16584
+ return NULL;
16585
+ }
16586
+
16587
+
16514
16588
SWIGINTERN PyObject *_wrap_SBCommandInterpreter_IsActive(PyObject *self, PyObject *args) {
16515
16589
PyObject *resultobj = 0;
16516
16590
lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ;
@@ -92259,6 +92333,7 @@ static PyMethodDef SwigMethods[] = {
92259
92333
{ "SBCommandInterpreter_HandleCompletionWithDescriptions", _wrap_SBCommandInterpreter_HandleCompletionWithDescriptions, METH_VARARGS, "SBCommandInterpreter_HandleCompletionWithDescriptions(SBCommandInterpreter self, char const * current_line, uint32_t cursor_pos, int match_start_point, int max_return_elements, SBStringList matches, SBStringList descriptions) -> int"},
92260
92334
{ "SBCommandInterpreter_WasInterrupted", _wrap_SBCommandInterpreter_WasInterrupted, METH_O, "SBCommandInterpreter_WasInterrupted(SBCommandInterpreter self) -> bool"},
92261
92335
{ "SBCommandInterpreter_InterruptCommand", _wrap_SBCommandInterpreter_InterruptCommand, METH_O, "SBCommandInterpreter_InterruptCommand(SBCommandInterpreter self) -> bool"},
92336
+ { "SBCommandInterpreter_SetCommandOverrideCallback", _wrap_SBCommandInterpreter_SetCommandOverrideCallback, METH_VARARGS, "SBCommandInterpreter_SetCommandOverrideCallback(SBCommandInterpreter self, char const * command_name, lldb::CommandOverrideCallback callback) -> bool"},
92262
92337
{ "SBCommandInterpreter_IsActive", _wrap_SBCommandInterpreter_IsActive, METH_O, "SBCommandInterpreter_IsActive(SBCommandInterpreter self) -> bool"},
92263
92338
{ "SBCommandInterpreter_GetIOHandlerControlSequence", _wrap_SBCommandInterpreter_GetIOHandlerControlSequence, METH_VARARGS, "SBCommandInterpreter_GetIOHandlerControlSequence(SBCommandInterpreter self, char ch) -> char const *"},
92264
92339
{ "SBCommandInterpreter_GetPromptOnQuit", _wrap_SBCommandInterpreter_GetPromptOnQuit, METH_O, "SBCommandInterpreter_GetPromptOnQuit(SBCommandInterpreter self) -> bool"},
0 commit comments