35 lines · cpp
1// clang-format off2// REQUIRES: lld, x863 4// Test that lldb can find the PDB file that corresponds to the executable. The linker5// writes a path to the PDB in the executable. If the PDB is not there, lldb should6// check the directory that contains the executable. We'll generate the PDB file in7// a subdirectory and then move it into the directory with the executable. That will8// ensure the PDB path stored in the executable is wrong.9 10// Build an EXE and PDB in different directories11// RUN: mkdir -p %t/executable12// RUN: rm -f %t/executable/foo.exe %t/executable/bar.pdb13// RUN: mkdir -p %t/symbols14// RUN: rm -f %t/symbols/bar.pdb15// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t/executable/foo.obj -- %s16// RUN: lld-link -debug:full -nodefaultlib -entry:main %t/executable/foo.obj \17// RUN: -out:%t/executable/foo.exe -pdb:%t/symbols/bar.pdb18 19// Find the PDB in its build location20// RUN: %lldb -f %t/executable/foo.exe -s \21// RUN: %p/Inputs/locate-pdb.lldbinit | FileCheck %s22 23// Also find the PDB when it's adjacent to the executable24// RUN: mv -f %t/symbols/bar.pdb %t/executable/bar.pdb25// RUN: %lldb -f %t/executable/foo.exe -s \26// RUN: %p/Inputs/locate-pdb.lldbinit | FileCheck %s27 28int main(int argc, char** argv) {29 return 0;30}31 32// CHECK: (lldb) target modules dump symfile33// CHECK: Dumping debug symbols for 1 modules.34// CHECK: SymbolFile native-pdb35