[Lldb-commits] [lldb] b352e62 - [lldb] Make process plugins check whether a hardware breakpoint is required
Tatyana Krasnukha via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 29 11:27:43 PDT 2020
Author: Tatyana Krasnukha
Date: 2020-07-29T21:27:23+03:00
New Revision: b352e62feadd0aabaa7373b6fb40701f00a6aa91
URL: https://github.com/llvm/llvm-project/commit/b352e62feadd0aabaa7373b6fb40701f00a6aa91
DIFF: https://github.com/llvm/llvm-project/commit/b352e62feadd0aabaa7373b6fb40701f00a6aa91.diff
LOG: [lldb] Make process plugins check whether a hardware breakpoint is required
Remove @skipIfWindows as process should report the error correctly on Windows now.
Differential Revision: https://reviews.llvm.org/D84255
Added:
Modified:
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
index a44080640f6c..f1a424ccbca5 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -683,6 +683,9 @@ ProcessFreeBSD::GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site) {
}
Status ProcessFreeBSD::EnableBreakpointSite(BreakpointSite *bp_site) {
+ if (bp_site->HardwareRequired())
+ return Status("Hardware breakpoints are not supported.");
+
return EnableSoftwareBreakpoint(bp_site);
}
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index dde25184a8c5..6e394eac6f9e 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -644,6 +644,9 @@ Status ProcessKDP::DoDeallocateMemory(lldb::addr_t addr) {
}
Status ProcessKDP::EnableBreakpointSite(BreakpointSite *bp_site) {
+ if (bp_site->HardwareRequired())
+ return Status("Hardware breakpoints are not supported.");
+
if (m_comm.LocalBreakpointsAreSupported()) {
Status error;
if (!bp_site->IsEnabled()) {
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index 7b020f55e993..96e2603b993e 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -150,6 +150,9 @@ lldb_private::ConstString ProcessWindows::GetPluginName() {
uint32_t ProcessWindows::GetPluginVersion() { return 1; }
Status ProcessWindows::EnableBreakpointSite(BreakpointSite *bp_site) {
+ if (bp_site->HardwareRequired())
+ return Status("Hardware breakpoints are not supported.");
+
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_BREAKPOINTS);
LLDB_LOG(log, "bp_site = {0:x}, id={1}, addr={2:x}", bp_site,
bp_site->GetID(), bp_site->GetLoadAddress());
diff --git a/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py b/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
index c97795f7ae67..dfb946036aa2 100644
--- a/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
+++ b/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
@@ -27,7 +27,6 @@ def test_breakpoint(self):
breakpoint = target.BreakpointCreateByLocation("main.c", 1)
self.assertTrue(breakpoint.IsHardware())
- @skipIfWindows
@expectedFailure(supports_hw_breakpoints)
def test_step_range(self):
"""Test stepping when hardware breakpoints are required."""
@@ -49,7 +48,6 @@ def test_step_range(self):
self.assertTrue("Could not create hardware breakpoint for thread plan"
in error.GetCString())
- @skipIfWindows
@expectedFailure(supports_hw_breakpoints)
def test_step_out(self):
"""Test stepping out when hardware breakpoints are required."""
@@ -70,7 +68,6 @@ def test_step_out(self):
self.assertTrue("Could not create hardware breakpoint for thread plan"
in error.GetCString())
- @skipIfWindows
@expectedFailure(supports_hw_breakpoints)
def test_step_over(self):
"""Test stepping over when hardware breakpoints are required."""
@@ -89,7 +86,6 @@ def test_step_over(self):
'error: Could not create hardware breakpoint for thread plan.'
])
- @skipIfWindows
@expectedFailure(supports_hw_breakpoints)
def test_step_until(self):
"""Test stepping until when hardware breakpoints are required."""
More information about the lldb-commits
mailing list