aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpoint.cpp
diff options
context:
space:
mode:
authorAlex Langford <alangford@apple.com>2024-01-08 10:51:00 -0800
committerGitHub <noreply@github.com>2024-01-08 10:51:00 -0800
commit07d6fbf8d80083470b4371f2ddabd656a9c317e6 (patch)
treec159847b6c23c884d3c76798f73b4ee753c2985b /lldb/source/Commands/CommandObjectBreakpoint.cpp
parenteb42868f25665ba6301a94a30e9df33e0d6ae61f (diff)
downloadllvm-07d6fbf8d80083470b4371f2ddabd656a9c317e6.zip
llvm-07d6fbf8d80083470b4371f2ddabd656a9c317e6.tar.gz
llvm-07d6fbf8d80083470b4371f2ddabd656a9c317e6.tar.bz2
[lldb][NFCI] Remove BreakpointIDList::InsertStringArray (#77161)
This abstraction is leaky and BreakpointIDList does not need to know about CommandReturnObject. Additionally, setting the CommandReturnObject inout param to a success state does very little. The function returns immediately if the input ArrayRef is empty, and reading CommandObjectMultiwordBreakpoint::VerifyIDs more closely, the input is always empty if the previous call to BreakpointIDList::FindAndReplaceIDRanges failed. If the call was successful, then the CommandReturnObject is already in a success state. I have opted to remove the function altogether and inline the functionality where it was used.
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 6349259..f9ba68e 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -2494,7 +2494,9 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(
// NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual
// BreakpointIDList:
- valid_ids->InsertStringArray(temp_args.GetArgumentArrayRef(), result);
+ for (llvm::StringRef temp_arg : temp_args.GetArgumentArrayRef())
+ if (auto bp_id = BreakpointID::ParseCanonicalReference(temp_arg))
+ valid_ids->AddBreakpointID(*bp_id);
// At this point, all of the breakpoint ids that the user passed in have
// been converted to breakpoint IDs and put into valid_ids.