This is an archive of the discontinued LLVM Phabricator instance.

[PDB] Better support for posix style paths in PDBs.
ClosedPublic

Authored by zturner on Oct 11 2018, 10:38 AM.

Details

Summary
While it doesn't make a *ton* of sense for POSIX paths to be
in PDBs, it's possible to occur in real scenarios involving
cross compilation.

The tools need to be able to handle this, because certain types
of debugging scenarios are possible without a running process
and so don't necessarily require you to be on a Windows system.
These include post-mortem debugging and binary forensics (e.g.
using a debugger to disassemble functions and examine symbols
without running the process).

There's changes in clang, LLD, and lldb in this patch.  After
this the cross-platform disassembly and source-list tests pass
on Linux.

Diff Detail

Event Timeline

zturner created this revision.Oct 11 2018, 10:38 AM

A couple of comments, but looks good otherwise.

lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp
156

This looks unused

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
533

Is it possible that it would start with a letter? Like D:\ etc...

This revision is now accepted and ready to land.Oct 11 2018, 10:45 AM
rnk accepted this revision.Oct 11 2018, 10:59 AM

I agree with the direction, but please update the commit message to make it clear what the new expected behavior of our tools is. Basically, they should generate native paths unless we have command line flags telling us to do something else.

lld/COFF/PDB.cpp
221–239

Please clean up these comments to make it clear that we have a new, simple rule for what we're doing: Creating absolute paths that work on the linker's host filesystem. If you want any other kind of behavior, the user should use /pdbsourcepath:.

This revision was automatically updated to reflect the committed changes.