[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 1 05:03:03 PDT 2020


labath added inline comments.


================
Comment at: lldb/test/Shell/Register/x86-fp-read.test:27-28
+# CHECK: fdivs (%{{[er]}}bx)
+print *(uint32_t*)($foseg * 0x100000000 + $fooff)
+# CHECK: (uint32_t) $1 = 0
+
----------------
zero is pretty common value. It would be better to check that the address actually points to the address of the `zero` variable. I think something like this ought to do it:
```
print &zero
# CHECK: (uint32_t *) $0 = [[ZERO:0x[0-9a-f]*]]
print (uint32_t*)($foseg * 0x100000000 + $fooff)
# CHECK: (uint32_t *) $1 = [[ZERO]]
```
Something similar can be done with the disassemble command too. That way we'll see the actual register value in case it turns out to be wrong.


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

https://reviews.llvm.org/D88583



More information about the lldb-commits mailing list