[lldb-dap] Cleanup InstructionBreakpoint - #200228
Merged
Merged
Conversation
|
@llvm/pr-subscribers-lldb Author: Sergei Druzhkov (DrSergei) ChangesAdded mutex like in other breakpoints (PR). Also removed unused Full diff: https://github.com/llvm/llvm-project/pull/200228.diff 2 Files Affected:
diff --git a/lldb/tools/lldb-dap/InstructionBreakpoint.cpp b/lldb/tools/lldb-dap/InstructionBreakpoint.cpp
index ddae1a8b20243..89a0983b07809 100644
--- a/lldb/tools/lldb-dap/InstructionBreakpoint.cpp
+++ b/lldb/tools/lldb-dap/InstructionBreakpoint.cpp
@@ -18,14 +18,16 @@ namespace lldb_dap {
InstructionBreakpoint::InstructionBreakpoint(
DAP &d, const protocol::InstructionBreakpoint &breakpoint)
: Breakpoint(d, breakpoint.condition, breakpoint.hitCondition),
- m_instruction_address_reference(LLDB_INVALID_ADDRESS),
- m_offset(breakpoint.offset.value_or(0)) {
+ m_instruction_address_reference(LLDB_INVALID_ADDRESS) {
llvm::StringRef instruction_reference(breakpoint.instructionReference);
instruction_reference.getAsInteger(0, m_instruction_address_reference);
- m_instruction_address_reference += m_offset;
+ m_instruction_address_reference += breakpoint.offset.value_or(0);
}
void InstructionBreakpoint::SetBreakpoint() {
+ lldb::SBMutex lock = m_dap.GetAPIMutex();
+ std::lock_guard<lldb::SBMutex> guard(lock);
+
m_bp =
m_dap.target.BreakpointCreateByAddress(m_instruction_address_reference);
Breakpoint::SetBreakpoint();
diff --git a/lldb/tools/lldb-dap/InstructionBreakpoint.h b/lldb/tools/lldb-dap/InstructionBreakpoint.h
index a8c8f2113e5eb..578926871f99b 100644
--- a/lldb/tools/lldb-dap/InstructionBreakpoint.h
+++ b/lldb/tools/lldb-dap/InstructionBreakpoint.h
@@ -33,7 +33,6 @@ class InstructionBreakpoint : public Breakpoint {
protected:
lldb::addr_t m_instruction_address_reference;
- int32_t m_offset;
};
} // namespace lldb_dap
|
da-viper
approved these changes
Jun 1, 2026
ashgti
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added mutex like in other breakpoints (PR). Also removed unused
m_offsetfield.