[PATCH] D34257: [PDB] Start emitting source file and line information

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 16:32:10 PDT 2017


zturner added a comment.

why not use the fancy new `yaml2obj` stuff instead of checking in binary `.obj` files for the test?



================
Comment at: lld/COFF/PDB.cpp:129
+/// - Filechecksum table offsets
+class DebugLinkerVisitor : public DebugSubsectionVisitor {
+  ObjectFile *File;
----------------
I know I wrote it and I feel bad finding all these reasons *not* to use it, but maybe we just shouldn't use the visitor here.  The only sections that we have to rewrite stuff from a `.debug$S` section are the symbols, string table, and checksums.  Just have a loop that iterates over each record and handle the sections we care about using internal knowledge of the records format to deserialize as little as possible (e.g. in file checksums, you only care about the first 4 bytes)


================
Comment at: lld/COFF/PDB.cpp:188
+                                     const StringsAndChecksumsRef &State) {
+  // FIXME: Delete all this code, we can just copy the data into the PDB
+  // directly.
----------------
Yea, if you do what I suggested above, then you can in fact just copy this whole buffer.  Because the "name offset" here is a name offset into the checksums buffer, which doesn't get merged with anything so the offset should stay the same.


https://reviews.llvm.org/D34257





More information about the llvm-commits mailing list