Previously, the DIA SDK didn't like the empty reference in the 'pdb' entry.
// RUN: %clang_cl /c /Z7 /Fo%t.obj -- %s
// RUN: llvm-pdbutil dump --types %t.obj | FileCheck %s
-// RUN: %clang_cl /c /Z7 %s /Fo%t.obj -fdebug-compilation-dir .
+// RUN: %clang_cl /c /Z7 /Fo%t.obj -fdebug-compilation-dir . -- %s
// RUN: llvm-pdbutil dump --types %t.obj | FileCheck %s --check-prefix RELATIVE
int main() { return 42; }
// CHECK: ============================================================
// CHECK: 0x[[PWD:.+]] | LF_STRING_ID [size = {{.+}}] ID: <no type>, String: [[PWDVAL:.+]]
// CHECK: 0x[[FILEPATH:.+]] | LF_STRING_ID [size = {{.+}}] ID: <no type>, String: [[FILEPATHVAL:.+[\\/]debug-info-codeview-buildinfo.c]]
+// CHECK: 0x[[ZIPDB:.+]] | LF_STRING_ID [size = {{.+}}] ID: <no type>, String:
// CHECK: 0x[[TOOL:.+]] | LF_STRING_ID [size = {{.+}}] ID: <no type>, String: [[TOOLVAL:.+[\\/]clang.*]]
// CHECK: 0x[[CMDLINE:.+]] | LF_STRING_ID [size = {{.+}}] ID: <no type>, String: "-cc1
// CHECK: 0x{{.+}} | LF_BUILDINFO [size = {{.+}}]
// CHECK: 0x[[PWD]]: `[[PWDVAL]]`
// CHECK: 0x[[TOOL]]: `[[TOOLVAL]]`
// CHECK: 0x[[FILEPATH]]: `[[FILEPATHVAL]]`
-// CHECK: <no type>: ``
+// CHECK: 0x[[ZIPDB]]: ``
// CHECK: 0x[[CMDLINE]]: `"-cc1
// RELATIVE: Types (.debug$T)
continue;
}
if (!LastArg.empty())
- FlatCmdLine += " ";
+ OS << " ";
llvm::sys::printArg(OS, Arg, /*Quote=*/true);
LastArg = Arg;
}
+ OS.flush();
return FlatCmdLine;
}
getStringIdTypeIdx(TypeTable, MainSourceFile->getDirectory());
BuildInfoArgs[BuildInfoRecord::SourceFile] =
getStringIdTypeIdx(TypeTable, MainSourceFile->getFilename());
+ // FIXME: PDB is intentionally blank unless we implement /Zi type servers.
+ BuildInfoArgs[BuildInfoRecord::TypeServerPDB] =
+ getStringIdTypeIdx(TypeTable, "");
if (Asm->TM.Options.MCOptions.Argv0 != nullptr) {
BuildInfoArgs[BuildInfoRecord::BuildTool] =
getStringIdTypeIdx(TypeTable, Asm->TM.Options.MCOptions.Argv0);
TypeTable, flattenCommandLine(Asm->TM.Options.MCOptions.CommandLineArgs,
MainSourceFile->getFilename()));
}
- // FIXME: PDB is intentionally blank unless we implement /Zi type servers.
BuildInfoRecord BIR(BuildInfoArgs);
TypeIndex BuildInfoIndex = TypeTable.writeLeafType(BIR);
; CHECK-NEXT: 0x{{.*}}: `D:\src\scopes\clang`
; CHECK-NEXT: <no type>: ``
; CHECK-NEXT: 0x{{.*}}: `D:\src\scopes\foo.cpp`
-; CHECK-NEXT: <no type>: ``
+; CHECK-NEXT: 0x{{.*}}: ``
; CHECK-NEXT: <no type>: ``
; CHECK: {{.*}} | S_BUILDINFO [size = 8] BuildId = `[[INFO_IDX]]`
; YAML: - 4470750F2E319329
; YAML: - 0FB556FD1FAB66D7
; YAML: - 5970EFB4874D0F3F
-; YAML: - EDB1D74C120CF44A
+; YAML: - D8EF11198C33843F
+; YAML: - D81F744D7366282B
; ...
; ASM: .asciz "t.cpp" # StringData
; ASM: .byte 242
; ASM: .byte 241
-; ASM: # BuildInfo (0x1015)
+; ASM: # StringId (0x1015)
+; ASM: .short 0xa # Record length
+; ASM: .short 0x1605 # Record kind: LF_STRING_ID
+; ASM: .long 0x0 # Id
+; ASM: .byte 0 # StringData
+; ASM: .byte 243
+; ASM: .byte 242
+; ASM: .byte 241
+; ASM: # BuildInfo (0x1016)
; ASM: .short 0x1a # Record length
; ASM: .short 0x1603 # Record kind: LF_BUILDINFO
; ASM: .short 0x5 # NumArgs
; ASM: .long 0x1013 # Argument: D:\src\llvm\build
; ASM: .long 0x0 # Argument
; ASM: .long 0x1014 # Argument: t.cpp
-; ASM: .long 0x0 # Argument
+; ASM: .long 0x1015 # Argument
; ASM: .long 0x0 # Argument
; ASM: .byte 242
; ASM: .byte 241
; ASM: .asciz "t.cpp" # StringData
; ASM: .byte 242
; ASM: .byte 241
-; ASM: # BuildInfo (0x1022)
+; ASM: # StringId (0x1022)
+; ASM: .short 0xa # Record length
+; ASM: .short 0x1605 # Record kind: LF_STRING_ID
+; ASM: .long 0x0 # Id
+; ASM: .byte 0 # StringData
+; ASM: .byte 243
+; ASM: .byte 242
+; ASM: .byte 241
+; ASM: # BuildInfo (0x1023)
; ASM: .short 0x1a # Record length
; ASM: .short 0x1603 # Record kind: LF_BUILDINFO
; ASM: .short 0x5 # NumArgs
; ASM: .long 0x1020 # Argument: D:\src\llvm\build
; ASM: .long 0x0 # Argument
; ASM: .long 0x1021 # Argument: t.cpp
-; ASM: .long 0x0 # Argument
+; ASM: .long 0x1022 # Argument
; ASM: .long 0x0 # Argument
; ASM: .byte 242
; ASM: .byte 241