OSDN Git Service

[codeview] Decode and dump FP regs from S_FRAMEPROC records
authorReid Kleckner <rnk@google.com>
Tue, 11 Sep 2018 22:00:50 +0000 (22:00 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 11 Sep 2018 22:00:50 +0000 (22:00 +0000)
commitb73f47d91f15ace55fd2cac20ea3a3d7689075f9
tree37d333f072d8cd9a0bd1defd8e01cb9761995bc4
parentaa090871e9be6cb42520ca60533c1d0d4e57bf8a
[codeview] Decode and dump FP regs from S_FRAMEPROC records

Summary:
There are two registers encoded in the S_FRAMEPROC flags: one for locals
and one for parameters. The encoding is described by the
ExpandEncodedBasePointerReg function in cvinfo.h. Two bits are used to
indicate one of four possible values:

  0: no register - Used when there are no variables.
  1: SP / standard - Variables are stored relative to the standard SP
     for the ISA.
  2: FP - Variables are addressed relative to the ISA frame
     pointer, i.e. EBP on x86. If realignment is required, parameters
     use this. If a dynamic alloca is used, locals will be EBP relative.
  3: Alternative - Variables are stored relative to some alternative
     third callee-saved register. This is required to address highly
     aligned locals when there are dynamic stack adjustments. In this
     case, both the incoming SP saved in the standard FP and the current
     SP are at some dynamic offset from the locals. LLVM uses ESI in
     this case, MSVC uses EBX.

Most of the changes in this patch are to pass around the CPU so that we
can decode these into real, named architectural registers.

Subscribers: hiraditya

Differential Revision: https://reviews.llvm.org/D51894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341999 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/CodeView/CodeView.h
include/llvm/DebugInfo/CodeView/SymbolDumper.h
include/llvm/DebugInfo/CodeView/SymbolRecord.h
lib/DebugInfo/CodeView/EnumTables.cpp
lib/DebugInfo/CodeView/SymbolDumper.cpp
test/DebugInfo/PDB/pdbdump-headers.test
tools/llvm-pdbutil/MinimalSymbolDumper.cpp
tools/llvm-pdbutil/MinimalSymbolDumper.h
tools/llvm-readobj/COFFDumper.cpp