diff options
| author | Jim Ingham <jingham@apple.com> | 2017-08-02 00:16:10 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2017-08-02 00:16:10 +0000 |
| commit | af26b22cd2156217bf03ac355cc1751693b00442 (patch) | |
| tree | ab1124ad40f9de909302b151256fd4804810dc0e /lldb/scripts/interface | |
| parent | 37c052f503877fce8596c8fdc3207c6f81033957 (diff) | |
| download | bcm5719-llvm-af26b22cd2156217bf03ac355cc1751693b00442.tar.gz bcm5719-llvm-af26b22cd2156217bf03ac355cc1751693b00442.zip | |
Fix a mis-feature with propagation of breakpoint options -> location options.
When an option was set at on a location, I was just copying the whole option set
to the location, and letting it shadow the breakpoint options. That was wrong since
it meant changes to unrelated options on the breakpoint would no longer take on this
location. I added a mask of set options and use that for option propagation.
I also added a "location" property to breakpoints, and added SBBreakpointLocation.{G,S}etCommandLineCommands
since I wanted to use them to write some more test cases.
<rdar://problem/24397798>
llvm-svn: 309772
Diffstat (limited to 'lldb/scripts/interface')
| -rw-r--r-- | lldb/scripts/interface/SBBreakpoint.i | 33 | ||||
| -rw-r--r-- | lldb/scripts/interface/SBBreakpointLocation.i | 4 |
2 files changed, 37 insertions, 0 deletions
diff --git a/lldb/scripts/interface/SBBreakpoint.i b/lldb/scripts/interface/SBBreakpoint.i index 95bc0cda005..e3b1eea0630 100644 --- a/lldb/scripts/interface/SBBreakpoint.i +++ b/lldb/scripts/interface/SBBreakpoint.i @@ -251,6 +251,39 @@ public: %pythoncode %{ + class locations_access(object): + '''A helper object that will lazily hand out locations for a breakpoint when supplied an index.''' + def __init__(self, sbbreakpoint): + self.sbbreakpoint = sbbreakpoint + + def __len__(self): + if self.sbbreakpoint: + return int(self.sbbreakpoint.GetNumLocations()) + return 0 + + def __getitem__(self, key): + if type(key) is int and key < len(self): + return self.sbbreakpoint.GetLocationAtIndex(key) + return None + + def get_locations_access_object(self): + '''An accessor function that returns a locations_access() object which allows lazy location access from a lldb.SBBreakpoint object.''' + return self.locations_access (self) + + def get_breakpoint_location_list(self): + '''An accessor function that returns a list() that contains all locations in a lldb.SBBreakpoint object.''' + locations = [] + accessor = self.get_locations_access_object() + for idx in range(len(accessor)): + locations.append(accessor[idx]) + return locations + + __swig_getmethods__["locations"] = get_breakpoint_location_list + if _newclass: locations = property(get_breakpoint_location_list, None, doc='''A read only property that returns a list() of lldb.SBBreakpointLocation objects for this breakpoint.''') + + __swig_getmethods__["location"] = get_locations_access_object + if _newclass: location = property(get_locations_access_object, None, doc='''A read only property that returns an object that can access locations by index (not location ID) (location = bkpt.location[12]).''') + __swig_getmethods__["id"] = GetID if _newclass: id = property(GetID, None, doc='''A read only property that returns the ID of this breakpoint.''') diff --git a/lldb/scripts/interface/SBBreakpointLocation.i b/lldb/scripts/interface/SBBreakpointLocation.i index 4a5aac031b4..5609c1f84f8 100644 --- a/lldb/scripts/interface/SBBreakpointLocation.i +++ b/lldb/scripts/interface/SBBreakpointLocation.i @@ -96,6 +96,10 @@ public: SBError SetScriptCallbackBody (const char *script_body_text); + void SetCommandLineCommands(SBStringList &commands); + + bool GetCommandLineCommands(SBStringList &commands); + void SetThreadID (lldb::tid_t sb_thread_id); |

