[Lldb-commits] [lldb] Move checking m_dummy_target to after raw-plus-option parsing. (PR #170888)

via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 5 09:24:30 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: None (jimingham)

<details>
<summary>Changes</summary>

CommandObjectBreakpointAddPattern is a raw command.  I was adjusting the patch for changes to handle the dummy target changes done while the patch was in review, and I copied the lines to the beginning of the DoExecute, but in the case of raw commands, you have to do the option parsing by hand, and this was before the parsing was done so the state wasn't determined yet.

---
Full diff: https://github.com/llvm/llvm-project/pull/170888.diff


1 Files Affected:

- (modified) lldb/source/Commands/CommandObjectBreakpoint.cpp (+3-2) 


``````````diff
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index c06b3ee028b69..8e163fbfb8942 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -1255,8 +1255,6 @@ class CommandObjectBreakpointAddPattern : public CommandObjectRaw {
                  CommandReturnObject &result) override {
     const bool internal = false;
     ExecutionContext exe_ctx = GetCommandInterpreter().GetExecutionContext();
-    Target &target =
-        m_dummy_options.m_use_dummy ? GetDummyTarget() : GetTarget();
     m_all_options.NotifyOptionParsingStarting(&exe_ctx);
 
     if (command.empty()) {
@@ -1279,6 +1277,9 @@ class CommandObjectBreakpointAddPattern : public CommandObjectRaw {
     }
     printf("Pattern: '%s'\n", pattern.str().c_str());
 
+    Target &target =
+        m_dummy_options.m_use_dummy ? GetDummyTarget() : GetTarget();
+
     BreakpointSP bp_sp;
     const size_t num_files = m_options.m_files.GetSize();
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/170888


More information about the lldb-commits mailing list