[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
Thu Oct 18 02:15:13 PDT 2018


aleksandr.urakov added a comment.

In https://reviews.llvm.org/D53086#1267988, @labath wrote:

> The thing that's not clear to me is: are you specifically interested in unwinding from these kinds of functions **without debug info**? Because it sounds to me like the info Zachary provided is enough to unwind from these functions, assuming debug info is present. And in this case there shouldn't be any need for instruction emulation.


Yes, it seems that the info is enough to restore some of unwind plan rows, but not all of them. Here is an FPO table for the code above (compiled with `cl /Zi /GS- /c a.cpp`, linked with `link /nodefaultlib /debug:full /entry:main a.obj`):

                          New FPO Data                        
  ============================================================
    RVA    | Code | Locals | Params | Stack | Prolog | Saved Regs | Has SEH | Has C++EH | Start | Program
  00001030 |   52 |    512 |      4 |     0 |     31 |          0 |   false |     false |  true | $T0 $ebp = $T1 $ebx = $eip $T1 4 + ^ = $ebx $T1 ^ = $esp $T1 8 + = $ebp $ebp ^ = 
  00001070 |   65 |    512 |      4 |     0 |     31 |          0 |   false |     false |  true | $T0 $ebp = $T1 $ebx = $eip $T1 4 + ^ = $ebx $T1 ^ = $esp $T1 8 + = $ebp $ebp ^ = 
  000010C0 |   20 |      0 |      0 |     0 |      3 |          0 |   false |     false |  true | $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = 

`1030` is the RVA of `foo`, `1070` - `bar`, `10C0` - `main`. So we can restore unwind rows for each function except for prologues and epilogues (however, I think that such restore is not so trivial too, we need to parse and convert an FPO program into a DWARF expression for each register). For prologues and epilogues we need to emulate instructions. And what about the problem with saved registers I've mentioned above? It seems exist on non-Windows too, and (correct me if I'm wrong, please) the unwind plan is restored from instruction emulation there for such cases? So we still need to support this in `x86AssemblyInspectionEngine`?


https://reviews.llvm.org/D53086





More information about the lldb-commits mailing list