HomePhabricator

[LLDB] Improve PDB discovery

Authored by amccarth on Jul 28 2020, 5:45 PM.

Description

[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

Details

Committed
amccarthAug 11 2020, 1:44 PM
Parents
rGdf79e18796d0: [libc][obvious] Remove a commented out block.
Branches
Unknown
Tags
Unknown