This is an archive of the discontinued LLVM Phabricator instance.

[PDB] Add documentation for the PDB DBI Stream.
ClosedPublic

Authored by zturner on Nov 11 2016, 11:10 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 77636.Nov 11 2016, 11:10 AM
zturner retitled this revision from to [PDB] Add documentation for the PDB DBI Stream..
zturner updated this object.
zturner added reviewers: rnk, ruiu, inglorion, majnemer, amccarth.
zturner added a subscriber: llvm-commits.
amccarth edited edge metadata.Nov 11 2016, 12:57 PM

Good content. I have just a couple wording nits.

docs/PDB/DbiStream.rst
17 ↗(On Diff #77636)

"containing" here is redundant and a tad confusing.

80 ↗(On Diff #77636)

Consistency nit: Elsewhere, you've been using e.g. and i.e. without a comma.

87 ↗(On Diff #77636)

Bit-field syntax is ambiguous because bit-fields can be allocated left-to-right or right-to-left (implementation defined). There are also implementation-defined padding and alignment issues.

129 ↗(On Diff #77636)

There's a wording problem here that makes this confusing. My first instinct would be to delete the of, but I'm not sure if that's exactly what you meant.

Also, you probably should have a hyphens in fixed-size and variable-length.

161 ↗(On Diff #77636)

hyphen: variable-length

zturner updated this revision to Diff 77659.Nov 11 2016, 1:00 PM
zturner edited edge metadata.

Updated

zturner added inline comments.Nov 11 2016, 1:01 PM
docs/PDB/DbiStream.rst
87 ↗(On Diff #77636)

While true, I need a concise way to express this since there are multiple bitfields defined throughout this file and in other files (some of which have not yet been written). If it was easy to insert images into RestructuredText, I could just draw it out, but I was hoping this could be understood to mean "the first 8 bits are X, the next 7 bits are Y, the final bit is Z", etc.

ruiu added inline comments.Nov 11 2016, 1:05 PM
docs/PDB/DbiStream.rst
87 ↗(On Diff #77636)

Why is this uint16? I wonder if this can be written as

uint8_t MinorVersion;
uint8_t MajorVersin : 7;
uint8_t NewVersionFormat : 1;
zturner added inline comments.Nov 11 2016, 1:08 PM
docs/PDB/DbiStream.rst
87 ↗(On Diff #77636)

No, because the bytes of the file are in little endian. If you run this code on a big endian machine, then one ulittle16_t is not the same as two uint8_t's. We read it into a ulittle16_t and then perform the bitwise operations on that.

ruiu added inline comments.Nov 11 2016, 1:15 PM
docs/PDB/DbiStream.rst
87 ↗(On Diff #77636)

Ah, right. But I found it a bit confusing (as I was confused) to use both uint16_t and ulittle16_t to mean little endian 16-bit integer. Maybe you might want to say at the beginning of the document that all values are in little endian and use uint{16,32}_t?

87 ↗(On Diff #77636)

Or, something like ulittle16_t X : 1, though it's not syntactically correct.

zturner updated this revision to Diff 77666.Nov 11 2016, 1:57 PM

Add a note that all numeric values are little endian, and then use standard C types instead of endian types in struct definitions.

ruiu accepted this revision.Nov 11 2016, 2:10 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 11 2016, 2:10 PM
amccarth accepted this revision.Nov 11 2016, 3:02 PM
amccarth edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.