Skip to content

Commit b352e62

Browse files
committed
[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
1 parent f7ec3e3 commit b352e62

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,9 @@ ProcessFreeBSD::GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site) {
683683
}
684684

685685
Status ProcessFreeBSD::EnableBreakpointSite(BreakpointSite *bp_site) {
686+
if (bp_site->HardwareRequired())
687+
return Status("Hardware breakpoints are not supported.");
688+
686689
return EnableSoftwareBreakpoint(bp_site);
687690
}
688691

lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@ Status ProcessKDP::DoDeallocateMemory(lldb::addr_t addr) {
644644
}
645645

646646
Status ProcessKDP::EnableBreakpointSite(BreakpointSite *bp_site) {
647+
if (bp_site->HardwareRequired())
648+
return Status("Hardware breakpoints are not supported.");
649+
647650
if (m_comm.LocalBreakpointsAreSupported()) {
648651
Status error;
649652
if (!bp_site->IsEnabled()) {

lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ lldb_private::ConstString ProcessWindows::GetPluginName() {
150150
uint32_t ProcessWindows::GetPluginVersion() { return 1; }
151151

152152
Status ProcessWindows::EnableBreakpointSite(BreakpointSite *bp_site) {
153+
if (bp_site->HardwareRequired())
154+
return Status("Hardware breakpoints are not supported.");
155+
153156
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_BREAKPOINTS);
154157
LLDB_LOG(log, "bp_site = {0:x}, id={1}, addr={2:x}", bp_site,
155158
bp_site->GetID(), bp_site->GetLoadAddress());

lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def test_breakpoint(self):
2727
breakpoint = target.BreakpointCreateByLocation("main.c", 1)
2828
self.assertTrue(breakpoint.IsHardware())
2929

30-
@skipIfWindows
3130
@expectedFailure(supports_hw_breakpoints)
3231
def test_step_range(self):
3332
"""Test stepping when hardware breakpoints are required."""
@@ -49,7 +48,6 @@ def test_step_range(self):
4948
self.assertTrue("Could not create hardware breakpoint for thread plan"
5049
in error.GetCString())
5150

52-
@skipIfWindows
5351
@expectedFailure(supports_hw_breakpoints)
5452
def test_step_out(self):
5553
"""Test stepping out when hardware breakpoints are required."""
@@ -70,7 +68,6 @@ def test_step_out(self):
7068
self.assertTrue("Could not create hardware breakpoint for thread plan"
7169
in error.GetCString())
7270

73-
@skipIfWindows
7471
@expectedFailure(supports_hw_breakpoints)
7572
def test_step_over(self):
7673
"""Test stepping over when hardware breakpoints are required."""
@@ -89,7 +86,6 @@ def test_step_over(self):
8986
'error: Could not create hardware breakpoint for thread plan.'
9087
])
9188

92-
@skipIfWindows
9389
@expectedFailure(supports_hw_breakpoints)
9490
def test_step_until(self):
9591
"""Test stepping until when hardware breakpoints are required."""

0 commit comments

Comments
 (0)