Skip to content

Conversation

@jimingham
Copy link
Collaborator

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.

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.
@llvmbot
Copy link
Member

llvmbot commented Dec 5, 2025

@llvm/pr-subscribers-lldb

Author: None (jimingham)

Changes

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 --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();
 

@jimingham
Copy link
Collaborator Author

This is a follow on to:

#156067

The test suite runs were clean for me except for one weird failure that seemed due to symbols-on-demand, but then I got a few other flakey failures, and fortunately the ASAN bots turned up the problem, which this PR should fix.

@jimingham
Copy link
Collaborator Author

I'm going to merge this w/o review. The patch is trivial and should fix some bot failures the previous PR caused.

@jimingham jimingham merged commit 35c664d into llvm:main Dec 5, 2025
12 checks passed
@jimingham jimingham deleted the check-after-option-parsing branch December 5, 2025 17:34
honeygoyal pushed a commit to honeygoyal/llvm-project that referenced this pull request Dec 9, 2025
…170888)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants