JDevlieghere created this revision.
JDevlieghere added reviewers: LLDB, jingham.
Herald added a project: LLDB.

Include whether or not a breakpoint is a hardware breakpoint in the breakpoint 
list.

  (lldb) breakpoint list
  Current breakpoints:
  1: name = 'main', locations = 1, resolved = 1, hit count = 0
    1.1: where = a.out`main + 15 at <stdin>:18:10, address = 
0x0000000100000f9f, resolved, hardware, hit count = 0
  
  (lldb) breakpoint list -v
  Current breakpoints:
  1: name = 'main'
      1.1:
        module = /Volumes/Jonas/llvm/build-ra/a.out
        compile unit = -
        function = main
        location = /Volumes/Jonas/llvm/build-ra/<stdin>:18:10
        address = 0x0000000100000f9f
        resolved = true
        hardware = true
        hit count = 0


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D73389

Files:
  lldb/include/lldb/Breakpoint/StoppointLocation.h
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
  lldb/source/Breakpoint/BreakpointLocation.cpp


Index: lldb/source/Breakpoint/BreakpointLocation.cpp
===================================================================
--- lldb/source/Breakpoint/BreakpointLocation.cpp
+++ lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -597,7 +597,8 @@
     s->EOL();
     s->Indent();
     s->Printf("resolved = %s\n", IsResolved() ? "true" : "false");
-
+    s->Indent();
+    s->Printf("hardware = %s\n", IsHardware() ? "true" : "false");
     s->Indent();
     s->Printf("hit count = %-4u\n", GetHitCount());
 
@@ -608,8 +609,8 @@
     }
     s->IndentLess();
   } else if (level != eDescriptionLevelInitial) {
-    s->Printf(", %sresolved, hit count = %u ", (IsResolved() ? "" : "un"),
-              GetHitCount());
+    s->Printf(", %sresolved, %shit count = %u ", (IsResolved() ? "" : "un"),
+              (IsHardware() ? "hardware, " : ""), GetHitCount());
     if (m_options_up) {
       m_options_up->GetDescription(s, level);
     }
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
===================================================================
--- 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
@@ -84,6 +84,10 @@
                 'hw_break_function',
                 'address = 0x'])
 
+        # 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'])
+
         # We should stop in hw_break_function function for 4 threads.
         count = 0
 
Index: lldb/include/lldb/Breakpoint/StoppointLocation.h
===================================================================
--- lldb/include/lldb/Breakpoint/StoppointLocation.h
+++ lldb/include/lldb/Breakpoint/StoppointLocation.h
@@ -41,7 +41,7 @@
   bool HardwareRequired() const { return m_hardware; }
 
   virtual bool IsHardware() const {
-    return m_hardware_index != LLDB_INVALID_INDEX32;
+    return m_hardware;
   }
 
   virtual bool ShouldStop(StoppointCallbackContext *context) { return true; }


Index: lldb/source/Breakpoint/BreakpointLocation.cpp
===================================================================
--- lldb/source/Breakpoint/BreakpointLocation.cpp
+++ lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -597,7 +597,8 @@
     s->EOL();
     s->Indent();
     s->Printf("resolved = %s\n", IsResolved() ? "true" : "false");
-
+    s->Indent();
+    s->Printf("hardware = %s\n", IsHardware() ? "true" : "false");
     s->Indent();
     s->Printf("hit count = %-4u\n", GetHitCount());
 
@@ -608,8 +609,8 @@
     }
     s->IndentLess();
   } else if (level != eDescriptionLevelInitial) {
-    s->Printf(", %sresolved, hit count = %u ", (IsResolved() ? "" : "un"),
-              GetHitCount());
+    s->Printf(", %sresolved, %shit count = %u ", (IsResolved() ? "" : "un"),
+              (IsHardware() ? "hardware, " : ""), GetHitCount());
     if (m_options_up) {
       m_options_up->GetDescription(s, level);
     }
Index: lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
@@ -84,6 +84,10 @@
                 'hw_break_function',
                 'address = 0x'])
 
+        # 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'])
+
         # We should stop in hw_break_function function for 4 threads.
         count = 0
 
Index: lldb/include/lldb/Breakpoint/StoppointLocation.h
===================================================================
--- lldb/include/lldb/Breakpoint/StoppointLocation.h
+++ lldb/include/lldb/Breakpoint/StoppointLocation.h
@@ -41,7 +41,7 @@
   bool HardwareRequired() const { return m_hardware; }
 
   virtual bool IsHardware() const {
-    return m_hardware_index != LLDB_INVALID_INDEX32;
+    return m_hardware;
   }
 
   virtual bool ShouldStop(StoppointCallbackContext *context) { return true; }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to