summaryrefslogtreecommitdiff
path: root/lldb/source/Breakpoint/BreakpointLocation.cpp
diff options
context:
space:
mode:
authorTatyana Krasnukha <tatyana@synopsys.com>2020-07-21 21:04:36 +0300
committerTatyana Krasnukha <tatyana@synopsys.com>2020-07-29 21:27:24 +0300
commitebaa8b1c60749883c6449a7c16096f1c40ccf4bc (patch)
tree5f9c03dcdcbed0575aa747a73f1328fda831f962 /lldb/source/Breakpoint/BreakpointLocation.cpp
parentb352e62feadd0aabaa7373b6fb40701f00a6aa91 (diff)
[lldb] Don't use hardware index to determine whether a breakpoint site is hardware
Most process plugins (if not all) don't set hardware index for breakpoints. They even are not able to determine this index. This patch makes StoppointLocation::IsHardware pure virtual and lets BreakpointSite override it using more accurate BreakpointSite::Type. It also adds assertions to be sure that a breakpoint site is hardware when this is required. Differential Revision: https://reviews.llvm.org/D84257
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointLocation.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointLocation.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp
index 93d54c051ee5..eae1c1e033ad 100644
--- a/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -68,6 +68,14 @@ Breakpoint &BreakpointLocation::GetBreakpoint() { return m_owner; }
Target &BreakpointLocation::GetTarget() { return m_owner.GetTarget(); }
+bool BreakpointLocation::IsHardware() const {
+ if (m_bp_site_sp)
+ return m_bp_site_sp->IsHardware();
+
+ // If breakpoint location is not resolved yet, it cannot be hardware.
+ return false;
+}
+
bool BreakpointLocation::IsEnabled() const {
if (!m_owner.IsEnabled())
return false;