llvm-project/lldb/source/Breakpoint
Joseph Tremoulet 95b2e516bd Change Target::FindBreakpointsByName to return Expected<vector>
Summary:
Using a BreakpointList corrupts the breakpoints' IDs because
BreakpointList::Add sets the ID, so use a vector instead, and
update the signature to return the vector wrapped in an
llvm::Expected which can propagate any error from the inner
call to StringIsBreakpointName.

Note that, despite the similar name, SBTarget::FindBreakpointsByName
doesn't suffer the same problem, because it uses a SBBreakpointList,
which is more like a BreakpointIDList than a BreakpointList under the
covers.

Add a check to TestBreakpointNames that, without this fix, notices the
ID getting mutated and fails.

Reviewers: jingham, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70907
2019-12-04 09:57:15 -05:00
..
Breakpoint.cpp [lldb] s/FileSpec::Equal/FileSpec::Match 2019-12-04 10:42:32 +01:00
BreakpointID.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BreakpointIDList.cpp [lldb][NFC] Remove ArgEntry::ref member 2019-09-13 11:26:48 +00:00
BreakpointList.cpp Change Target::FindBreakpointsByName to return Expected<vector> 2019-12-04 09:57:15 -05:00
BreakpointLocation.cpp [lldb] Remove FileSpec->CompileUnit inheritance 2019-11-29 11:44:45 +01:00
BreakpointLocationCollection.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
BreakpointLocationList.cpp Remove redundant ::get() for smart pointer. (NFC) 2019-02-12 03:47:39 +00:00
BreakpointName.cpp Fix file names in file headers. NFC 2019-05-13 04:42:32 +00:00
BreakpointOptions.cpp [lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescription 2019-12-02 13:27:21 +01:00
BreakpointPrecondition.cpp [Target] Decouple ObjCLanguageRuntime from LanguageRuntime 2019-06-21 19:43:07 +00:00
BreakpointResolver.cpp Implement serializing scripted breakpoints and their extra args. 2019-10-10 17:44:50 +00:00
BreakpointResolverAddress.cpp [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallback 2019-10-10 11:26:51 +00:00
BreakpointResolverFileLine.cpp [lldb][NFC] Remove strange bool parameter from Searcher::SearchCallback 2019-10-10 11:26:51 +00:00
BreakpointResolverFileRegex.cpp [lldb] Remove FileSpec->CompileUnit inheritance 2019-11-29 11:44:45 +01:00
BreakpointResolverName.cpp Modernize the rest of the Find.* API (NFC) 2019-10-17 19:56:40 +00:00
BreakpointResolverScripted.cpp Implement serializing scripted breakpoints and their extra args. 2019-10-10 17:44:50 +00:00
BreakpointSite.cpp Copy the breakpoint site owner's collection so we can drop 2019-03-28 01:51:33 +00:00
BreakpointSiteList.cpp Remove redundant ::get() for smart pointer. (NFC) 2019-02-12 03:47:39 +00:00
CMakeLists.txt [Target] Decouple ObjCLanguageRuntime from LanguageRuntime 2019-06-21 19:43:07 +00:00
Stoppoint.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
StoppointCallbackContext.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StoppointLocation.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
Watchpoint.cpp [Symbol] Use llvm::Expected when getting TypeSystems 2019-07-30 22:12:34 +00:00
WatchpointList.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WatchpointOptions.cpp [lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescription 2019-12-02 13:27:21 +01:00