[all-commits] [llvm/llvm-project] 95b2e5: Change Target::FindBreakpointsByName to return Exp...

Joseph Tremoulet via All-commits all-commits at lists.llvm.org
Wed Dec 4 06:57:51 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 95b2e516bd3e4587953e44bf062054ff84f2b057
      https://github.com/llvm/llvm-project/commit/95b2e516bd3e4587953e44bf062054ff84f2b057
  Author: Joseph Tremoulet <jotrem at microsoft.com>
  Date:   2019-12-04 (Wed, 04 Dec 2019)

  Changed paths:
    M lldb/include/lldb/Breakpoint/BreakpointList.h
    M lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
    M lldb/source/API/SBTarget.cpp
    M lldb/source/Breakpoint/BreakpointList.cpp
    M lldb/source/Target/Target.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list