diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-01-24 19:17:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-06 20:13:49 +0000 |
commit | 7a6dacaca14b62ca4b74406814becb87a3fefac0 (patch) | |
tree | 273a870ac27484bb1f5ee55e7ef0dc0d061f63e7 /contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 46c59ea9b61755455ff6bf9f3e7b834e1af634ea (diff) | |
parent | 4df029cc74e5ec124f14a5682e44999ce4f086df (diff) |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp b/contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp index f9ba68eda3ff..1661d5d9b743 100644 --- a/contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/contrib/llvm-project/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -2488,8 +2488,12 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs( // breakpoint ids in the range, and shove all of those breakpoint id strings // into TEMP_ARGS. - BreakpointIDList::FindAndReplaceIDRanges(args, target, allow_locations, - purpose, result, temp_args); + if (llvm::Error err = BreakpointIDList::FindAndReplaceIDRanges( + args, target, allow_locations, purpose, temp_args)) { + result.SetError(std::move(err)); + return; + } + result.SetStatus(eReturnStatusSuccessFinishNoResult); // NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual // BreakpointIDList: @@ -2501,33 +2505,31 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs( // At this point, all of the breakpoint ids that the user passed in have // been converted to breakpoint IDs and put into valid_ids. - if (result.Succeeded()) { - // Now that we've converted everything from args into a list of breakpoint - // ids, go through our tentative list of breakpoint id's and verify that - // they correspond to valid/currently set breakpoints. - - const size_t count = valid_ids->GetSize(); - for (size_t i = 0; i < count; ++i) { - BreakpointID cur_bp_id = valid_ids->GetBreakpointIDAtIndex(i); - Breakpoint *breakpoint = - target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get(); - if (breakpoint != nullptr) { - const size_t num_locations = breakpoint->GetNumLocations(); - if (static_cast<size_t>(cur_bp_id.GetLocationID()) > num_locations) { - StreamString id_str; - BreakpointID::GetCanonicalReference( - &id_str, cur_bp_id.GetBreakpointID(), cur_bp_id.GetLocationID()); - i = valid_ids->GetSize() + 1; - result.AppendErrorWithFormat( - "'%s' is not a currently valid breakpoint/location id.\n", - id_str.GetData()); - } - } else { + // Now that we've converted everything from args into a list of breakpoint + // ids, go through our tentative list of breakpoint id's and verify that + // they correspond to valid/currently set breakpoints. + + const size_t count = valid_ids->GetSize(); + for (size_t i = 0; i < count; ++i) { + BreakpointID cur_bp_id = valid_ids->GetBreakpointIDAtIndex(i); + Breakpoint *breakpoint = + target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get(); + if (breakpoint != nullptr) { + const size_t num_locations = breakpoint->GetNumLocations(); + if (static_cast<size_t>(cur_bp_id.GetLocationID()) > num_locations) { + StreamString id_str; + BreakpointID::GetCanonicalReference( + &id_str, cur_bp_id.GetBreakpointID(), cur_bp_id.GetLocationID()); i = valid_ids->GetSize() + 1; result.AppendErrorWithFormat( - "'%d' is not a currently valid breakpoint ID.\n", - cur_bp_id.GetBreakpointID()); + "'%s' is not a currently valid breakpoint/location id.\n", + id_str.GetData()); } + } else { + i = valid_ids->GetSize() + 1; + result.AppendErrorWithFormat( + "'%d' is not a currently valid breakpoint ID.\n", + cur_bp_id.GetBreakpointID()); } } } |