[Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 7 07:43:47 PDT 2015


labath added a subscriber: lldb-commits.

================
Comment at: test/functionalities/register/TestRegisters.py:195
@@ +194,3 @@
+            for x in range(0,16):
+                self.runCmd ("si", RUN_SUCCEEDED)
+
----------------
First I would like to applaud for writing a test case for such a delicate issue. I know it's not easy given the current test infrastructure.

However, this change seems very fragile and likely to break due to random changes in clang implementation and/or command line flags. Even the gcc path can break if the gcc happens to produce slightly different output. I would like to avoid relying on hardcoded instruction counts.

How about we try something like this:
- in the inline assembly, we prepend the code you want to test with "int3"
- run the inferior normally. it should hit the debugger trap and stop (you can verify that the stop reason is indeed sigtrap)
- the next instruction should point precisely at the code you want to test, without relying on any debug info or instruction counts
- proceed with the test normally

what do you think?


http://reviews.llvm.org/D12677





More information about the lldb-commits mailing list