33 lines · cpp
1// clang-format off2// REQUIRES: lld, x863 4// Test that lldb load PDB file by command `target symbols add`5 6// RUN: mkdir -p %t/executable7// RUN: rm -f %t/executable/foo.exe %t/executable/bar.pdb8// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t/executable/foo.obj -- %s9// RUN: lld-link -debug:full -nodefaultlib -entry:main %t/executable/foo.obj \10// RUN: -out:%t/executable/foo.exe -pdb:%t/executable/foo.pdb11// Rename the PDB file so that the name is different from the name inside the executable (foo.exe).12// RUN: mv %t/executable/foo.pdb %t/executable/bar.pdb13// RUN: %lldb %t/executable/foo.exe \14// RUN: -o "target symbols add %t/executable/bar.pdb" \15// RUN: -o "b main" \16// RUN: -o "image dump symfile" -o "quit" | FileCheck %s17 18int main(int argc, char** argv) {19 return 0;20}21 22// CHECK: (lldb) target symbols add {{.*}}bar.pdb23// CHECK: symbol file '{{.*}}bar.pdb' has been added to '{{.*}}foo.exe'24// CHECK: (lldb) b main25// CHECK: Breakpoint 1: where = foo.exe`main + 21 at load-pdb.cpp:19, address = 0x000000014000101526// CHECK: (lldb) image dump symfile27// CHECK: Types:28// CHECK: {{.*}}: Type{0x00010024} , size = 0, compiler_type = {{.*}} int (int, char **)29// CHECK: Compile units:30// CHECK: {{.*}}: CompileUnit{0x00000000}, language = "c++", file = '{{.*}}load-pdb.cpp'31// CHECK: {{.*}}: Function{{{.*}}}, demangled = main, type = {{.*}}32// CHECK: {{.*}}: Block{{{.*}}}33