This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Expose the PE debug data directory and dump it
ClosedPublic

Authored by rnk on Jun 1 2016, 4:07 PM.

Details

Summary

This directory is used to find if there is a PDB associated with an
executable. I plan to use this functionality to teach llvm-symbolizer
whether it should use DIA or DWARF to symbolize a given DLL.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 59297.Jun 1 2016, 4:07 PM
rnk retitled this revision from to [COFF] Expose the PE debug data directory and dump it.
rnk updated this object.
rnk added a reviewer: majnemer.
rnk added a subscriber: llvm-commits.
majnemer added inline comments.Jun 1 2016, 4:27 PM
lib/Object/COFFObjectFile.cpp
462 ↗(On Diff #59297)

What about overflow? I reckon we should return an error if SectionEnd < SectionStart.

tools/llvm-readobj/COFFDumper.cpp
691–692 ↗(On Diff #59297)

Really, 12 and 13?

rnk added inline comments.Jun 1 2016, 4:52 PM
lib/Object/COFFObjectFile.cpp
462 ↗(On Diff #59297)

I tried to tighten this up. PTAL

tools/llvm-readobj/COFFDumper.cpp
691–692 ↗(On Diff #59297)

Sure. The enum is defined in decimal, but printEnum prints in hex, so I'm not sure which is more obvious.

rnk updated this revision to Diff 59309.Jun 1 2016, 4:53 PM
  • overflow
majnemer accepted this revision.Jun 1 2016, 4:55 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 1 2016, 4:55 PM
majnemer added inline comments.Jun 1 2016, 10:42 PM
tools/llvm-readobj/COFFDumper.cpp
691–692 ↗(On Diff #59309)

Found 'em!
https://github.com/dotnet/roslyn/issues/5940#issue-111295100

Looks like they are:

#define IMAGE_DEBUG_TYPE_VC_FEATURE       12
#define IMAGE_DEBUG_TYPE_POGO             13
#define IMAGE_DEBUG_TYPE_ILTCG            14
#define IMAGE_DEBUG_TYPE_MPX              15
#define IMAGE_DEBUG_TYPE_NO_TIMESTAMP  16
This revision was automatically updated to reflect the committed changes.