[Lldb-commits] [PATCH] D79563: [lldb/test] Make "inline" tests handle multiple statements at the same location

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 7 05:03:38 PDT 2020


labath updated this revision to Diff 262614.
labath added a comment.

- disable a check that fails now. AFAICT, this never worked.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79563/new/

https://reviews.llvm.org/D79563

Files:
  lldb/packages/Python/lldbsuite/test/lldbinline.py
  lldb/test/API/commands/expression/dollar-in-variable/main.c


Index: lldb/test/API/commands/expression/dollar-in-variable/main.c
===================================================================
--- lldb/test/API/commands/expression/dollar-in-variable/main.c
+++ lldb/test/API/commands/expression/dollar-in-variable/main.c
@@ -17,5 +17,5 @@
   //%self.expect("expr $foo", substrs=['(int)', ' = 12'])
   //%self.expect("expr $R0", substrs=['(int)', ' = 13'])
   //%self.expect("expr int $foo = 123", error=True, substrs=["declaration conflicts"])
-  return 0; //%self.expect("expr $0", substrs=['(int)', ' = 14'])
+  return 0; //TODO: self.expect("expr $0", substrs=['(int)', ' = 14'])
 }
Index: lldb/packages/Python/lldbsuite/test/lldbinline.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -126,6 +126,13 @@
     def execute_user_command(self, __command):
         exec(__command, globals(), locals())
 
+    def _get_breakpoint_ids(self, thread):
+        ids = set()
+        for i in range(0, thread.GetStopReasonDataCount(), 2):
+            ids.add(thread.GetStopReasonDataAtIndex(i))
+        self.assertGreater(len(ids), 0)
+        return sorted(ids)
+
     def do_test(self):
         exe = self.getBuildArtifact("a.out")
         source_files = [f for f in os.listdir(self.getSourceDir())
@@ -145,8 +152,8 @@
             hit_breakpoints += 1
             thread = lldbutil.get_stopped_thread(
                 process, lldb.eStopReasonBreakpoint)
-            breakpoint_id = thread.GetStopReasonDataAtIndex(0)
-            parser.handle_breakpoint(self, breakpoint_id)
+            for id in self._get_breakpoint_ids(thread):
+                parser.handle_breakpoint(self, id)
             process.Continue()
 
         self.assertTrue(hit_breakpoints > 0,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79563.262614.patch
Type: text/x-patch
Size: 1844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200507/9e91a823/attachment-0001.bin>


More information about the lldb-commits mailing list