[Lldb-commits] [PATCH] D53086: [PDB] Fix flaky `variables-locations.test` after PR38857

Aleksandr Urakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 16 04:30:59 PDT 2018


aleksandr.urakov added a comment.

Yes, I mean exactly the same case. For sequences like you've written yes, the unwind should work, but there must be some problems with saved registers. `x86AssemblyInspectionEngine` doesn't handle instructions like `and %-8, %esp`, so the register save would work only if this instruction hadn't changed the `esp` value (e.g. `esp` was already aligned). Otherwise, if `esp` was changed, the offset to CFA in `RegisterLocation` of some register will be invalid, because it will not take the alignment into account.

Moreover, it is impossible to specify a location for some saved register on a such stack with the `CFA + offset` restore type, because we can't know how `esp` will be changed after `and %-8, %esp`. So I suggest to introduce one more frame address (along with CFA), and make it point to `esp` right after `and ..., %esp`. So any saved register would have `AFA + offset` restore type (I've called for now this frame address as AFA - aligned frame address).

As for MSVC-compiled sources, the things are even more interesting. Consider the following program:


https://reviews.llvm.org/D53086





More information about the lldb-commits mailing list