[all-commits] [llvm/llvm-project] 479f5b: [LLDB] Improve PDB discovery

amccarth-google via All-commits all-commits at lists.llvm.org
Tue Aug 11 13:45:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 479f5bfdb02b191f03b3de1a7c3d5a5098b3fcaf
      https://github.com/llvm/llvm-project/commit/479f5bfdb02b191f03b3de1a7c3d5a5098b3fcaf
  Author: Adrian McCarthy <amccarth at google.com>
  Date:   2020-08-11 (Tue, 11 Aug 2020)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
    A lldb/test/Shell/SymbolFile/NativePDB/Inputs/locate-pdb.lldbinit
    A lldb/test/Shell/SymbolFile/NativePDB/locate-pdb.cpp

  Log Message:
  -----------
  [LLDB] Improve PDB discovery

When loading a PE/COFF target, the associated PDB file often wasn't
found.  The executable module contains a path for the associated PDB
file, but people often debug from a different directory than the one
their build system uses.  (This is especially common in post-mortem
and cross platform debugging.)

Suppose the COFF executable being debugged is `~/proj/foo.exe`, but
it was built elsewhere and refers to `D:\remote\build\env\foobar.pdb`,
LLDB wouldn't find it.

With this change, if no file exists at the PDB path, LLDB will look
in the executable directory for a PDB file that matches the name of
the one it expected (e.g., `~/proj/foobar.pdb`).  If found, the PDB
is subject to the same matching criteria (GUIDs and age) as would
have been used had it been in the original location.

This same-directory-as-the-binary rule is commonly used by debuggers
on Windows.

Differential Review: https://reviews.llvm.org/D84815




More information about the All-commits mailing list