#include "lldb/Breakpoint/BreakpointLocationCollection.h"
#include "lldb/Breakpoint/StoppointLocation.h"
+#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/UserID.h"
#include "lldb/lldb-forward.h"
/// \b false otherwise.
bool IsInternal() const;
+ bool IsHardware() const override {
+ lldbassert(BreakpointSite::Type::eHardware == GetType() ||
+ !HardwareRequired());
+ return BreakpointSite::Type::eHardware == GetType();
+ }
+
BreakpointSite::Type GetType() const { return m_type; }
void SetType(BreakpointSite::Type type) { m_type = type; }
break;
case BreakpointSite::eExternal: {
- GDBStoppointType stoppoint_type;
- if (bp_site->IsHardware())
- stoppoint_type = eBreakpointHardware;
- else
- stoppoint_type = eBreakpointSoftware;
-
- if (m_gdb_comm.SendGDBStoppointTypePacket(stoppoint_type, false, addr,
- bp_op_size))
+ if (m_gdb_comm.SendGDBStoppointTypePacket(eBreakpointSoftware, false,
+ addr, bp_op_size))
error.SetErrorToGenericError();
} break;
}
def does_not_support_hw_breakpoints(self):
return not super().supports_hw_breakpoints()
- # LLDB on linux supports hardware breakpoints for arm and aarch64
- # architectures.
- @skipUnlessPlatform(oslist=['linux'])
- @skipTestIfFn(does_not_support_hw_breakpoints)
- def test_hw_break_set_delete_multi_thread_linux(self):
- self.build()
- self.setTearDownCleanup()
- self.break_multi_thread('delete', False) # llvm.org/PR44659
-
- # LLDB on linux supports hardware breakpoints for arm and aarch64
- # architectures.
- @skipUnlessPlatform(oslist=['linux'])
- @skipTestIfFn(does_not_support_hw_breakpoints)
- def test_hw_break_set_disable_multi_thread_linux(self):
- self.build()
- self.setTearDownCleanup()
- self.break_multi_thread('disable', False) # llvm.org/PR44659
-
- # LLDB on darwin supports hardware breakpoints for x86_64 and i386
- # architectures.
- @skipUnlessDarwin
@skipIfOutOfTreeDebugserver
@skipTestIfFn(does_not_support_hw_breakpoints)
def test_hw_break_set_delete_multi_thread_macos(self):
self.setTearDownCleanup()
self.break_multi_thread('delete')
- # LLDB on darwin supports hardware breakpoints for x86_64 and i386
- # architectures.
- @skipUnlessDarwin
@skipIfOutOfTreeDebugserver
@skipTestIfFn(does_not_support_hw_breakpoints)
def test_hw_break_set_disable_multi_thread_macos(self):
self.setTearDownCleanup()
self.break_multi_thread('disable')
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
self.first_stop = line_number(
self.source, 'Starting thread creation with hardware breakpoint set')
- def break_multi_thread(self, removal_type, check_hw_bp=True):
+ def break_multi_thread(self, removal_type):
"""Test that lldb hardware breakpoints work for multiple threads."""
self.runCmd("file " + self.getBuildArtifact("a.out"),
CURRENT_EXECUTABLE_SET)
# Continue the loop and test that we are stopped 4 times.
count += 1
- if check_hw_bp:
- # Check the breakpoint list.
- self.expect("breakpoint list", substrs=['hw_break_function', 'hardware'])
- self.expect("breakpoint list -v", substrs=['function = hw_break_function', 'hardware = true'])
+ # Check the breakpoint list.
+ self.expect("breakpoint list", substrs=['hw_break_function', 'hardware'])
+ self.expect("breakpoint list -v", substrs=['function = hw_break_function', 'hardware = true'])
if removal_type == 'delete':
self.runCmd("settings set auto-confirm true")