Skip to content

Commit aff144f

Browse files
authored
Merge pull request #6722 from medismailben/swift/release/5.9
2 parents e31edb8 + c23049a commit aff144f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1706
-152
lines changed

lldb/bindings/interface/SBAttachInfo.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ public:
113113
void
114114
SetListener (lldb::SBListener &listener);
115115

116+
SBListener
117+
GetShadowListener();
118+
119+
void
120+
SetShadowListener(SBListener &listener);
121+
116122
const char *
117123
GetScriptedProcessClassName() const;
118124

lldb/bindings/interface/SBError.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class SBError {
5959
public:
6060
SBError ();
6161

62+
SBError(const char *message);
63+
6264
SBError (const lldb::SBError &rhs);
6365

6466
~SBError();

lldb/bindings/interface/SBLaunchInfo.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public:
4949
void
5050
SetListener (lldb::SBListener &listener);
5151

52+
SBListener
53+
GetShadowListener();
54+
55+
void
56+
SetShadowListener(SBListener &listener);
57+
5258
uint32_t
5359
GetNumArguments ();
5460

lldb/bindings/interface/SBProcess.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ public:
241241
void
242242
SendAsyncInterrupt();
243243

244+
void
245+
ForceScriptedState(StateType new_state);
246+
244247
%feature("autodoc", "
245248
Reads memory from the current process's address space and removes any
246249
traps that may have been inserted into the memory. It returns the byte
@@ -341,6 +344,9 @@ public:
341344
lldb::SBBroadcaster
342345
GetBroadcaster () const;
343346

347+
static const char *
348+
GetBroadcasterClass();
349+
344350
bool
345351
GetDescription (lldb::SBStream &description);
346352

lldb/bindings/interface/SBTarget.i

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ public:
10491049

10501050
def get_modules_access_object(self):
10511051
'''An accessor function that returns a modules_access() object which allows lazy module access from a lldb.SBTarget object.'''
1052-
return self.modules_access (self)
1052+
return self.modules_access(self)
10531053

10541054
def get_modules_array(self):
10551055
'''An accessor function that returns a list() that contains all modules in a lldb.SBTarget object.'''
@@ -1068,18 +1068,81 @@ public:
10681068
object.'''
10691069
return lldb_iter(self, 'GetNumBreakpoints', 'GetBreakpointAtIndex')
10701070

1071+
class bkpts_access(object):
1072+
'''A helper object that will lazily hand out bkpts for a target when supplied an index.'''
1073+
def __init__(self, sbtarget):
1074+
self.sbtarget = sbtarget
1075+
1076+
def __len__(self):
1077+
if self.sbtarget:
1078+
return int(self.sbtarget.GetNumBreakpoints())
1079+
return 0
1080+
1081+
def __getitem__(self, key):
1082+
if isinstance(key, int):
1083+
count = len(self)
1084+
if -count <= key < count:
1085+
key %= count
1086+
return self.sbtarget.GetBreakpointAtIndex(key)
1087+
return None
1088+
1089+
def get_bkpts_access_object(self):
1090+
'''An accessor function that returns a bkpts_access() object which allows lazy bkpt access from a lldb.SBtarget object.'''
1091+
return self.bkpts_access(self)
1092+
1093+
def get_target_bkpts(self):
1094+
'''An accessor function that returns a list() that contains all bkpts in a lldb.SBtarget object.'''
1095+
bkpts = []
1096+
for idx in range(self.GetNumBreakpoints()):
1097+
bkpts.append(self.GetBreakpointAtIndex(idx))
1098+
return bkpts
1099+
10711100
def watchpoint_iter(self):
10721101
'''Returns an iterator over all watchpoints in a lldb.SBTarget
10731102
object.'''
10741103
return lldb_iter(self, 'GetNumWatchpoints', 'GetWatchpointAtIndex')
10751104

1105+
class watchpoints_access(object):
1106+
'''A helper object that will lazily hand out watchpoints for a target when supplied an index.'''
1107+
def __init__(self, sbtarget):
1108+
self.sbtarget = sbtarget
1109+
1110+
def __len__(self):
1111+
if self.sbtarget:
1112+
return int(self.sbtarget.GetNumWatchpoints())
1113+
return 0
1114+
1115+
def __getitem__(self, key):
1116+
if isinstance(key, int):
1117+
count = len(self)
1118+
if -count <= key < count:
1119+
key %= count
1120+
return self.sbtarget.GetWatchpointAtIndex(key)
1121+
return None
1122+
1123+
def get_watchpoints_access_object(self):
1124+
'''An accessor function that returns a watchpoints_access() object which allows lazy watchpoint access from a lldb.SBtarget object.'''
1125+
return self.watchpoints_access(self)
1126+
1127+
def get_target_watchpoints(self):
1128+
'''An accessor function that returns a list() that contains all watchpoints in a lldb.SBtarget object.'''
1129+
watchpoints = []
1130+
for idx in range(self.GetNumWatchpoints()):
1131+
bkpts.append(self.GetWatchpointAtIndex(idx))
1132+
return watchpoints
1133+
1134+
10761135
modules = property(get_modules_array, None, doc='''A read only property that returns a list() of lldb.SBModule objects contained in this target. This list is a list all modules that the target currently is tracking (the main executable and all dependent shared libraries).''')
10771136
module = property(get_modules_access_object, None, doc=r'''A read only property that returns an object that implements python operator overloading with the square brackets().\n target.module[<int>] allows array access to any modules.\n target.module[<str>] allows access to modules by basename, full path, or uuid string value.\n target.module[uuid.UUID()] allows module access by UUID.\n target.module[re] allows module access using a regular expression that matches the module full path.''')
10781137
process = property(GetProcess, None, doc='''A read only property that returns an lldb object that represents the process (lldb.SBProcess) that this target owns.''')
10791138
executable = property(GetExecutable, None, doc='''A read only property that returns an lldb object that represents the main executable module (lldb.SBModule) for this target.''')
10801139
debugger = property(GetDebugger, None, doc='''A read only property that returns an lldb object that represents the debugger (lldb.SBDebugger) that owns this target.''')
10811140
num_breakpoints = property(GetNumBreakpoints, None, doc='''A read only property that returns the number of breakpoints that this target has as an integer.''')
1141+
breakpoints = property(get_target_bkpts, None, doc='''A read only property that returns a list() of lldb.SBBreakpoint objects for all breakpoints in this target.''')
1142+
breakpoint = property(get_bkpts_access_object, None, doc='''A read only property that returns an object that can be used to access breakpoints as an array ("bkpt_12 = lldb.target.bkpt[12]").''')
10821143
num_watchpoints = property(GetNumWatchpoints, None, doc='''A read only property that returns the number of watchpoints that this target has as an integer.''')
1144+
watchpoints = property(get_target_watchpoints, None, doc='''A read only property that returns a list() of lldb.SBwatchpoint objects for all watchpoints in this target.''')
1145+
watchpoint = property(get_watchpoints_access_object, None, doc='''A read only property that returns an object that can be used to access watchpoints as an array ("watchpoint_12 = lldb.target.watchpoint[12]").''')
10831146
broadcaster = property(GetBroadcaster, None, doc='''A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this target.''')
10841147
byte_order = property(GetByteOrder, None, doc='''A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this target.''')
10851148
addr_size = property(GetAddressByteSize, None, doc='''A read only property that returns the size in bytes of an address for this target.''')

lldb/bindings/python/python-wrapper.swig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,18 @@ void *lldb_private::LLDBSWIGPython_CastPyObjectToSBData(PyObject * data) {
690690
return sb_ptr;
691691
}
692692

693+
void *lldb_private::LLDBSWIGPython_CastPyObjectToSBBreakpoint(PyObject * data) {
694+
lldb::SBBreakpoint *sb_ptr = nullptr;
695+
696+
int valid_cast =
697+
SWIG_ConvertPtr(data, (void **)&sb_ptr, SWIGTYPE_p_lldb__SBBreakpoint, 0);
698+
699+
if (valid_cast == -1)
700+
return NULL;
701+
702+
return sb_ptr;
703+
}
704+
693705
void *lldb_private::LLDBSWIGPython_CastPyObjectToSBAttachInfo(PyObject * data) {
694706
lldb::SBAttachInfo *sb_ptr = nullptr;
695707

0 commit comments

Comments
 (0)