[PATCH] Teach the llvm-readobj COFF dumper to dump debug line tables from object files

Timur Iskhodzhanov timurrrr at google.com
Thu Dec 19 03:41:40 PST 2013


  Going to land this now


================
Comment at: tools/llvm-readobj/COFFDumper.cpp:669
@@ +668,3 @@
+    W.printHex("Magic", Magic);
+    if (Magic != 4) {
+      error(object_error::parse_failed);
----------------
Eric Christopher wrote:
> 4? An enum maybe or something else?
Done

================
Comment at: tools/llvm-readobj/COFFDumper.cpp:694
@@ +693,3 @@
+      switch (SubSectionType) {
+      case 0xF2: {
+        // F2 is a PC to file:line table.  Some data to parse this subsection is
----------------
Eric Christopher wrote:
> Same here with F2, F3, F4...
Good point - added an enum to `include/llvm/Support/COFF.h`

================
Comment at: tools/llvm-readobj/COFFDumper.cpp:787
@@ +786,3 @@
+          StringTable.data()[FilenameOffsetInF3 - 1] != '\0') {
+        // Each string in an F3 subsection should be preceded by a null
+        // character.
----------------
Eric Christopher wrote:
> Preceded? Awesome.
Yes, each string is both preceded (checked here) and succeeded (that's why we check for the EOL null) by a null character.
Two adjacent strings share the delimiting null character like so:
`|0xF3|Size|0x0|String1|0x0|String2|0x0|...|0x0|StringLast|0x0|`


http://llvm-reviews.chandlerc.com/D2425



More information about the llvm-commits mailing list