Skip to content

Commit adb227f

Browse files
committed
[lldb] Regenerate the static bindings
1 parent 30a0cf4 commit adb227f

File tree

2 files changed

+240
-1
lines changed

2 files changed

+240
-1
lines changed

lldb/bindings/python/static-binding/LLDBWrapPython.cpp

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64135,6 +64135,66 @@ SWIGINTERN PyObject *_wrap_SBThreadPlan_IsPlanStale(PyObject *SWIGUNUSEDPARM(sel
6413564135
}
6413664136

6413764137

64138+
SWIGINTERN PyObject *_wrap_SBThreadPlan_GetStopOthers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
64139+
PyObject *resultobj = 0;
64140+
lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ;
64141+
void *argp1 = 0 ;
64142+
int res1 = 0 ;
64143+
PyObject *swig_obj[1] ;
64144+
bool result;
64145+
64146+
if (!args) SWIG_fail;
64147+
swig_obj[0] = args;
64148+
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBThreadPlan, 0 | 0 );
64149+
if (!SWIG_IsOK(res1)) {
64150+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBThreadPlan_GetStopOthers" "', argument " "1"" of type '" "lldb::SBThreadPlan *""'");
64151+
}
64152+
arg1 = reinterpret_cast< lldb::SBThreadPlan * >(argp1);
64153+
{
64154+
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
64155+
result = (bool)(arg1)->GetStopOthers();
64156+
SWIG_PYTHON_THREAD_END_ALLOW;
64157+
}
64158+
resultobj = SWIG_From_bool(static_cast< bool >(result));
64159+
return resultobj;
64160+
fail:
64161+
return NULL;
64162+
}
64163+
64164+
64165+
SWIGINTERN PyObject *_wrap_SBThreadPlan_SetStopOthers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
64166+
PyObject *resultobj = 0;
64167+
lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ;
64168+
bool arg2 ;
64169+
void *argp1 = 0 ;
64170+
int res1 = 0 ;
64171+
bool val2 ;
64172+
int ecode2 = 0 ;
64173+
PyObject *swig_obj[2] ;
64174+
64175+
if (!SWIG_Python_UnpackTuple(args, "SBThreadPlan_SetStopOthers", 2, 2, swig_obj)) SWIG_fail;
64176+
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_lldb__SBThreadPlan, 0 | 0 );
64177+
if (!SWIG_IsOK(res1)) {
64178+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SBThreadPlan_SetStopOthers" "', argument " "1"" of type '" "lldb::SBThreadPlan *""'");
64179+
}
64180+
arg1 = reinterpret_cast< lldb::SBThreadPlan * >(argp1);
64181+
ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
64182+
if (!SWIG_IsOK(ecode2)) {
64183+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SBThreadPlan_SetStopOthers" "', argument " "2"" of type '" "bool""'");
64184+
}
64185+
arg2 = static_cast< bool >(val2);
64186+
{
64187+
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
64188+
(arg1)->SetStopOthers(arg2);
64189+
SWIG_PYTHON_THREAD_END_ALLOW;
64190+
}
64191+
resultobj = SWIG_Py_Void();
64192+
return resultobj;
64193+
fail:
64194+
return NULL;
64195+
}
64196+
64197+
6413864198
SWIGINTERN PyObject *_wrap_SBThreadPlan_QueueThreadPlanForStepOverRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6413964199
PyObject *resultobj = 0;
6414064200
lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ;
@@ -80183,6 +80243,127 @@ LLDBSwigPythonCallBreakpointResolver
8018380243
return ret_val;
8018480244
}
8018580245

80246+
SWIGEXPORT void *
80247+
LLDBSwigPythonCreateScriptedStopHook
80248+
(
80249+
lldb::TargetSP target_sp,
80250+
const char *python_class_name,
80251+
const char *session_dictionary_name,
80252+
lldb_private::StructuredDataImpl *args_impl,
80253+
Status &error
80254+
)
80255+
{
80256+
if (python_class_name == NULL || python_class_name[0] == '\0') {
80257+
error.SetErrorString("Empty class name.");
80258+
Py_RETURN_NONE;
80259+
}
80260+
if (!session_dictionary_name) {
80261+
error.SetErrorString("No session dictionary");
80262+
Py_RETURN_NONE;
80263+
}
80264+
80265+
PyErr_Cleaner py_err_cleaner(true);
80266+
80267+
auto dict =
80268+
PythonModule::MainModule().ResolveName<PythonDictionary>(
80269+
session_dictionary_name);
80270+
auto pfunc =
80271+
PythonObject::ResolveNameWithDictionary<PythonCallable>(
80272+
python_class_name, dict);
80273+
80274+
if (!pfunc.IsAllocated()) {
80275+
error.SetErrorStringWithFormat("Could not find class: %s.",
80276+
python_class_name);
80277+
return nullptr;
80278+
}
80279+
80280+
lldb::SBTarget *target_val
80281+
= new lldb::SBTarget(target_sp);
80282+
80283+
PythonObject target_arg(PyRefType::Owned, SBTypeToSWIGWrapper(target_val));
80284+
80285+
lldb::SBStructuredData *args_value = new lldb::SBStructuredData(args_impl);
80286+
PythonObject args_arg(PyRefType::Owned, SBTypeToSWIGWrapper(args_value));
80287+
80288+
PythonObject result = pfunc(target_arg, args_arg, dict);
80289+
80290+
if (result.IsAllocated())
80291+
{
80292+
// Check that the handle_stop callback is defined:
80293+
auto callback_func = result.ResolveName<PythonCallable>("handle_stop");
80294+
if (callback_func.IsAllocated()) {
80295+
if (auto args_info = callback_func.GetArgInfo()) {
80296+
size_t num_args = (*args_info).max_positional_args;
80297+
if (num_args != 2) {
80298+
error.SetErrorStringWithFormat("Wrong number of args for "
80299+
"handle_stop callback, should be 2 (excluding self), got: %d",
80300+
num_args);
80301+
Py_RETURN_NONE;
80302+
} else
80303+
return result.release();
80304+
} else {
80305+
error.SetErrorString("Couldn't get num arguments for handle_stop "
80306+
"callback.");
80307+
Py_RETURN_NONE;
80308+
}
80309+
return result.release();
80310+
}
80311+
else {
80312+
error.SetErrorStringWithFormat("Class \"%s\" is missing the required "
80313+
"handle_stop callback.",
80314+
python_class_name);
80315+
result.release();
80316+
}
80317+
}
80318+
Py_RETURN_NONE;
80319+
}
80320+
80321+
SWIGEXPORT bool
80322+
LLDBSwigPythonStopHookCallHandleStop
80323+
(
80324+
void *implementor,
80325+
lldb::ExecutionContextRefSP exc_ctx_sp,
80326+
lldb::StreamSP stream
80327+
)
80328+
{
80329+
// handle_stop will return a bool with the meaning "should_stop"...
80330+
// If you return nothing we'll assume we are going to stop.
80331+
// Also any errors should return true, since we should stop on error.
80332+
80333+
PyErr_Cleaner py_err_cleaner(false);
80334+
PythonObject self(PyRefType::Borrowed, static_cast<PyObject*>(implementor));
80335+
auto pfunc = self.ResolveName<PythonCallable>("handle_stop");
80336+
80337+
if (!pfunc.IsAllocated())
80338+
return true;
80339+
80340+
PythonObject result;
80341+
lldb::SBExecutionContext sb_exc_ctx(exc_ctx_sp);
80342+
PythonObject exc_ctx_arg(PyRefType::Owned, SBTypeToSWIGWrapper(sb_exc_ctx));
80343+
lldb::SBStream sb_stream;
80344+
PythonObject sb_stream_arg(PyRefType::Owned,
80345+
SBTypeToSWIGWrapper(sb_stream));
80346+
result = pfunc(exc_ctx_arg, sb_stream_arg);
80347+
80348+
if (PyErr_Occurred())
80349+
{
80350+
stream->PutCString("Python error occurred handling stop-hook.");
80351+
PyErr_Print();
80352+
PyErr_Clear();
80353+
return true;
80354+
}
80355+
80356+
// Now add the result to the output stream. SBStream only
80357+
// makes an internally help StreamString which I can't interpose, so I
80358+
// have to copy it over here.
80359+
stream->PutCString(sb_stream.GetData());
80360+
80361+
if (result.get() == Py_False)
80362+
return false;
80363+
else
80364+
return true;
80365+
}
80366+
8018680367
// wrapper that calls an optional instance member of an object taking no arguments
8018780368
static PyObject*
8018880369
LLDBSwigPython_CallOptionalMember
@@ -83893,6 +84074,11 @@ static PyMethodDef SwigMethods[] = {
8389384074
{ "SBThreadPlan_SetPlanComplete", _wrap_SBThreadPlan_SetPlanComplete, METH_VARARGS, "SBThreadPlan_SetPlanComplete(SBThreadPlan self, bool success)"},
8389484075
{ "SBThreadPlan_IsPlanComplete", _wrap_SBThreadPlan_IsPlanComplete, METH_O, "SBThreadPlan_IsPlanComplete(SBThreadPlan self) -> bool"},
8389584076
{ "SBThreadPlan_IsPlanStale", _wrap_SBThreadPlan_IsPlanStale, METH_O, "SBThreadPlan_IsPlanStale(SBThreadPlan self) -> bool"},
84077+
{ "SBThreadPlan_GetStopOthers", _wrap_SBThreadPlan_GetStopOthers, METH_O, "\n"
84078+
"SBThreadPlan_GetStopOthers(SBThreadPlan self) -> bool\n"
84079+
"Return whether this plan will ask to stop other threads when it runs.\n"
84080+
""},
84081+
{ "SBThreadPlan_SetStopOthers", _wrap_SBThreadPlan_SetStopOthers, METH_VARARGS, "SBThreadPlan_SetStopOthers(SBThreadPlan self, bool stop_others)"},
8389684082
{ "SBThreadPlan_QueueThreadPlanForStepOverRange", _wrap_SBThreadPlan_QueueThreadPlanForStepOverRange, METH_VARARGS, "SBThreadPlan_QueueThreadPlanForStepOverRange(SBThreadPlan self, SBAddress start_address, lldb::addr_t range_size) -> SBThreadPlan"},
8389784083
{ "SBThreadPlan_QueueThreadPlanForStepInRange", _wrap_SBThreadPlan_QueueThreadPlanForStepInRange, METH_VARARGS, "SBThreadPlan_QueueThreadPlanForStepInRange(SBThreadPlan self, SBAddress start_address, lldb::addr_t range_size) -> SBThreadPlan"},
8389884084
{ "SBThreadPlan_QueueThreadPlanForStepOut", _wrap_SBThreadPlan_QueueThreadPlanForStepOut, METH_VARARGS, "SBThreadPlan_QueueThreadPlanForStepOut(SBThreadPlan self, uint32_t frame_idx_to_step_to, bool first_insn=False) -> SBThreadPlan"},
@@ -86308,6 +86494,7 @@ SWIG_init(void) {
8630886494
SWIG_Python_SetConstant(d, "LLDB_INVALID_SIGNAL_NUMBER",SWIG_From_int(static_cast< int >(2147483647)));
8630986495
SWIG_Python_SetConstant(d, "LLDB_INVALID_OFFSET",SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(18446744073709551615ULL)));
8631086496
SWIG_Python_SetConstant(d, "LLDB_INVALID_LINE_NUMBER",SWIG_From_unsigned_SS_int(static_cast< unsigned int >(4294967295U)));
86497+
SWIG_Python_SetConstant(d, "LLDB_INVALID_COLUMN_NUMBER",SWIG_From_int(static_cast< int >(0)));
8631186498
SWIG_Python_SetConstant(d, "LLDB_INVALID_QUEUE_ID",SWIG_From_int(static_cast< int >(0)));
8631286499
SWIG_Python_SetConstant(d, "LLDB_ARCH_DEFAULT",SWIG_FromCharPtr("systemArch"));
8631386500
SWIG_Python_SetConstant(d, "LLDB_ARCH_DEFAULT_32BIT",SWIG_FromCharPtr("systemArch32"));
@@ -86326,6 +86513,7 @@ SWIG_init(void) {
8632686513
SWIG_Python_SetConstant(d, "LLDB_OPT_SET_9",SWIG_From_unsigned_SS_int(static_cast< unsigned int >((1U << 8))));
8632786514
SWIG_Python_SetConstant(d, "LLDB_OPT_SET_10",SWIG_From_unsigned_SS_int(static_cast< unsigned int >((1U << 9))));
8632886515
SWIG_Python_SetConstant(d, "LLDB_OPT_SET_11",SWIG_From_unsigned_SS_int(static_cast< unsigned int >((1U << 10))));
86516+
SWIG_Python_SetConstant(d, "LLDB_OPT_SET_12",SWIG_From_unsigned_SS_int(static_cast< unsigned int >((1U << 11))));
8632986517
SWIG_Python_SetConstant(d, "eStateInvalid",SWIG_From_int(static_cast< int >(lldb::eStateInvalid)));
8633086518
SWIG_Python_SetConstant(d, "eStateUnloaded",SWIG_From_int(static_cast< int >(lldb::eStateUnloaded)));
8633186519
SWIG_Python_SetConstant(d, "eStateConnected",SWIG_From_int(static_cast< int >(lldb::eStateConnected)));
@@ -86608,6 +86796,7 @@ SWIG_init(void) {
8660886796
SWIG_Python_SetConstant(d, "eArgTypeExpression",SWIG_From_int(static_cast< int >(lldb::eArgTypeExpression)));
8660986797
SWIG_Python_SetConstant(d, "eArgTypeExpressionPath",SWIG_From_int(static_cast< int >(lldb::eArgTypeExpressionPath)));
8661086798
SWIG_Python_SetConstant(d, "eArgTypeExprFormat",SWIG_From_int(static_cast< int >(lldb::eArgTypeExprFormat)));
86799+
SWIG_Python_SetConstant(d, "eArgTypeFileLineColumn",SWIG_From_int(static_cast< int >(lldb::eArgTypeFileLineColumn)));
8661186800
SWIG_Python_SetConstant(d, "eArgTypeFilename",SWIG_From_int(static_cast< int >(lldb::eArgTypeFilename)));
8661286801
SWIG_Python_SetConstant(d, "eArgTypeFormat",SWIG_From_int(static_cast< int >(lldb::eArgTypeFormat)));
8661386802
SWIG_Python_SetConstant(d, "eArgTypeFrameIndex",SWIG_From_int(static_cast< int >(lldb::eArgTypeFrameIndex)));

lldb/bindings/python/static-binding/lldb.py

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ def __init__(self):
199199

200200
LLDB_INVALID_LINE_NUMBER = _lldb.LLDB_INVALID_LINE_NUMBER
201201

202+
LLDB_INVALID_COLUMN_NUMBER = _lldb.LLDB_INVALID_COLUMN_NUMBER
203+
202204
LLDB_INVALID_QUEUE_ID = _lldb.LLDB_INVALID_QUEUE_ID
203205

204206
LLDB_ARCH_DEFAULT = _lldb.LLDB_ARCH_DEFAULT
@@ -235,6 +237,8 @@ def __init__(self):
235237

236238
LLDB_OPT_SET_11 = _lldb.LLDB_OPT_SET_11
237239

240+
LLDB_OPT_SET_12 = _lldb.LLDB_OPT_SET_12
241+
238242
eStateInvalid = _lldb.eStateInvalid
239243

240244
eStateUnloaded = _lldb.eStateUnloaded
@@ -799,6 +803,8 @@ def __init__(self):
799803

800804
eArgTypeExprFormat = _lldb.eArgTypeExprFormat
801805

806+
eArgTypeFileLineColumn = _lldb.eArgTypeFileLineColumn
807+
802808
eArgTypeFilename = _lldb.eArgTypeFilename
803809

804810
eArgTypeFormat = _lldb.eArgTypeFormat
@@ -11645,6 +11651,17 @@ def IsPlanStale(self):
1164511651
r"""IsPlanStale(SBThreadPlan self) -> bool"""
1164611652
return _lldb.SBThreadPlan_IsPlanStale(self)
1164711653

11654+
def GetStopOthers(self):
11655+
r"""
11656+
GetStopOthers(SBThreadPlan self) -> bool
11657+
Return whether this plan will ask to stop other threads when it runs.
11658+
"""
11659+
return _lldb.SBThreadPlan_GetStopOthers(self)
11660+
11661+
def SetStopOthers(self, stop_others):
11662+
r"""SetStopOthers(SBThreadPlan self, bool stop_others)"""
11663+
return _lldb.SBThreadPlan_SetStopOthers(self, stop_others)
11664+
1164811665
def QueueThreadPlanForStepOverRange(self, start_address, range_size):
1164911666
r"""QueueThreadPlanForStepOverRange(SBThreadPlan self, SBAddress start_address, lldb::addr_t range_size) -> SBThreadPlan"""
1165011667
return _lldb.SBThreadPlan_QueueThreadPlanForStepOverRange(self, start_address, range_size)
@@ -12653,7 +12670,19 @@ def __str__(self):
1265312670
_lldb.SBTypeEnumMember_swigregister(SBTypeEnumMember)
1265412671

1265512672
class SBTypeEnumMemberList(object):
12656-
r"""Represents a list of SBTypeEnumMembers."""
12673+
r"""
12674+
Represents a list of SBTypeEnumMembers.
12675+
SBTypeEnumMemberList supports SBTypeEnumMember iteration.
12676+
It also supports [] access either by index, or by enum
12677+
element name by doing:
12678+
12679+
myType = target.FindFirstType('MyEnumWithElementA')
12680+
members = myType.GetEnumMembers()
12681+
first_elem = members[0]
12682+
elem_A = members['A']
12683+
12684+
12685+
"""
1265712686

1265812687
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1265912688
__repr__ = _swig_repr
@@ -12688,6 +12717,27 @@ def GetSize(self):
1268812717
r"""GetSize(SBTypeEnumMemberList self) -> uint32_t"""
1268912718
return _lldb.SBTypeEnumMemberList_GetSize(self)
1269012719

12720+
def __iter__(self):
12721+
'''Iterate over all members in a lldb.SBTypeEnumMemberList object.'''
12722+
return lldb_iter(self, 'GetSize', 'GetTypeEnumMemberAtIndex')
12723+
12724+
def __len__(self):
12725+
'''Return the number of members in a lldb.SBTypeEnumMemberList object.'''
12726+
return self.GetSize()
12727+
12728+
def __getitem__(self, key):
12729+
num_elements = self.GetSize()
12730+
if type(key) is int:
12731+
if key < num_elements:
12732+
return self.GetTypeEnumMemberAtIndex(key)
12733+
elif type(key) is str:
12734+
for idx in range(num_elements):
12735+
item = self.GetTypeEnumMemberAtIndex(idx)
12736+
if item.name == key:
12737+
return item
12738+
return None
12739+
12740+
1269112741
# Register SBTypeEnumMemberList in _lldb:
1269212742
_lldb.SBTypeEnumMemberList_swigregister(SBTypeEnumMemberList)
1269312743

0 commit comments

Comments
 (0)