This is an archive of the discontinued LLVM Phabricator instance.

Read the rest of the substreams from DBI, and parse source file information
ClosedPublic

Authored by zturner on Apr 27 2016, 3:20 PM.

Details

Summary

We now read out the rest of the substreams from the DBI streams. One of these substreams, the FileInfo substream, contains information about which source files contribute to each module (aka compiland). This patch additionally parses out the file information from that substream, and dumps it in llvm-pdbdump.

Diff Detail

Event Timeline

zturner updated this revision to Diff 55339.Apr 27 2016, 3:20 PM
zturner retitled this revision from to Read the rest of the substreams from DBI, and parse source file information.
zturner updated this object.
zturner added a reviewer: ruiu.
zturner added a subscriber: llvm-commits.
ruiu added inline comments.Apr 27 2016, 4:09 PM
include/llvm/DebugInfo/PDB/Raw/PDBDbiStream.h
47 ↗(On Diff #55339)

Why don't you return ArrayRef<ModuleInfoEx>?

lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp
183–186 ↗(On Diff #55339)

This can return ArrayRef<ModuleInfoEx>?

zturner updated this revision to Diff 55357.Apr 27 2016, 4:40 PM

Return ArrayRef instead of an iterator range.

majnemer added inline comments.
include/llvm/DebugInfo/PDB/Raw/ModInfo.h
47 ↗(On Diff #55357)

Maybe make the parameter be a const &

lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp
51 ↗(On Diff #55357)

Would it be easier to decode this field if it were named something like NumGlobalSyms or NumGlobalSymbols?

191 ↗(On Diff #55357)

I'd be nice if the readBytes interface took a MutableArrayRef<uint8_t>. Then you'd just pass in the std::vector.

216–218 ↗(On Diff #55357)

Couldn't you also do:

auto *Buf = reinterpret_cast<const ulittle16_t *>(&FileInfoSubstream[1]);
zturner added inline comments.Apr 27 2016, 9:44 PM
lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp
51 ↗(On Diff #55357)

Actually I'm not 100% sure that that's even what it is. I could change it now, or wait till we actually start using it (which I assume by then I'll be more certain about its purpose)

191 ↗(On Diff #55357)

I've actually got a patch in progress that completely refactors the stream reading interface to make it so that I can read from mapped block streams and contiguous byte arrays (e.g. substreams) with the same interface. It might make more sense to change it in that patch since it focuses on the stream reading interface anyway.

zturner added inline comments.Apr 27 2016, 9:54 PM
lib/DebugInfo/PDB/Raw/PDBDbiStream.cpp
216–218 ↗(On Diff #55357)

Did you mean

auto *Buf = reinterpret_cast<const ulittle16_t*>(FI + 1);

?

This revision was not accepted when it landed; it landed in state Needs Review.Oct 7 2019, 7:04 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 7:04 AM
Herald added a subscriber: hiraditya. · View Herald Transcript