[CodeView] Dump BuildInfoSym and ProcSym type indices

I need to print the type index in hex so that I can match it in
FileCheck for a test I'm writing.

llvm-svn: 308107
This commit is contained in:
Reid Kleckner 2017-07-15 18:10:39 +00:00
parent 06d823b92d
commit af88a910fd
6 changed files with 10 additions and 9 deletions

View File

@ -56,7 +56,7 @@ CHECK: flags = has async eh | opt speed
CHECK: 196 | S_END [size = 4]
CHECK: 200 | S_GDATA32 [size = 24] `global`
CHECK: type = 0x0074 (int), addr = 0000:0000
CHECK: 224 | S_BUILDINFO [size = 8] BuildId = `4106`
CHECK: 224 | S_BUILDINFO [size = 8] BuildId = `0x100A`
CHECK: 232 | S_GPROC32_ID [size = 44] `foo`
CHECK: parent = 0, end = 308, addr = 0002:0032, code size = 15
CHECK: debug start = 0, debug end = 14, flags = none
@ -81,7 +81,7 @@ CHECK: flags = has async eh | opt speed
CHECK: 196 | S_END [size = 4]
CHECK: 200 | S_GDATA32 [size = 24] `global`
CHECK: type = 0x0074 (int), addr = 0000:0000
CHECK: 224 | S_BUILDINFO [size = 8] BuildId = `4109`
CHECK: 224 | S_BUILDINFO [size = 8] BuildId = `0x100D`
CHECK-NOT: S_GPROC32_ID {{.*}} `foo`
CHECK-LABEL: Mod 0002 | `* Linker *`:

View File

@ -35,7 +35,7 @@
# CHECK: original type = 0x1004
# CHECK: 240 | S_UDT [size = 12] `Foo`
# CHECK: original type = 0x1004
# CHECK: 252 | S_BUILDINFO [size = 8] BuildId = `4106`
# CHECK: 252 | S_BUILDINFO [size = 8] BuildId = `0x100A`
# CHECK-LABEL: Mod 0001 | `* Linker *`:
--- !COFF

View File

@ -848,7 +848,7 @@ public:
: SymbolRecord(SymbolRecordKind::BuildInfoSym),
RecordOffset(RecordOffset) {}
uint32_t BuildId;
TypeIndex BuildId;
uint32_t RecordOffset;
};

View File

@ -186,7 +186,7 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
BuildInfoSym &BuildInfo) {
W.printNumber("BuildId", BuildInfo.BuildId);
printTypeIndex("BuildId", BuildInfo.BuildId);
return Error::success();
}

View File

@ -472,13 +472,13 @@ ALL-NEXT: frontend = 18.0.31101.0, backend = 18.0.31101.0
ALL-NEXT: flags = security checks
ALL-NEXT: 120 | S_GPROC32 [size = 44] `main`
ALL-NEXT: parent = 0, end = 196, addr = 0001:0016, code size = 10
ALL-NEXT: debug start = 3, debug end = 8, flags = has fp
ALL-NEXT: type = `0x1001 (int ())`, debug start = 3, debug end = 8, flags = has fp
ALL-NEXT: 164 | S_FRAMEPROC [size = 32]
ALL-NEXT: size = 0, padding size = 0, offset to padding = 0
ALL-NEXT: bytes of callee saved registers = 0, exception handler addr = 0000:0000
ALL-NEXT: flags = has async eh | opt speed
ALL-NEXT: 196 | S_END [size = 4]
ALL-NEXT: 200 | S_BUILDINFO [size = 8] BuildId = `4110`
ALL-NEXT: 200 | S_BUILDINFO [size = 8] BuildId = `0x100E`
ALL-NEXT: Mod 0001 | `* Linker *`:
ALL-NEXT: 4 | S_OBJNAME [size = 20] sig=0, `* Linker *`
ALL-NEXT: 24 | S_COMPILE3 [size = 48]

View File

@ -725,8 +725,9 @@ Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, ProcSym &Proc) {
Proc.Parent, Proc.End,
formatSegmentOffset(Proc.Segment, Proc.CodeOffset),
Proc.CodeSize);
P.formatLine("debug start = {0}, debug end = {1}, flags = {2}", Proc.DbgStart,
Proc.DbgEnd,
// FIXME: It seems FunctionType is sometimes an id and sometimes a type.
P.formatLine("type = `{0}`, debug start = {1}, debug end = {2}, flags = {3}",
typeIndex(Proc.FunctionType), Proc.DbgStart, Proc.DbgEnd,
formatProcSymFlags(P.getIndentLevel() + 9, Proc.Flags));
return Error::success();
}