[PATCH] COFFDumper: Dump data directory entries.

Nico Rieck nico.rieck at gmail.com
Mon Jul 15 18:50:51 PDT 2013



================
Comment at: test/tools/llvm-readobj/file-headers.test:111
@@ -112,1 +110,3 @@
+PE32-NEXT:   SectionCount: 3
+PE32-NEXT:   TimeDateStamp:
 PE32-NEXT:   PointerToSymbolTable: 0x0
----------------
Please verify and include the new timestamp here because it's relevant to this test.

================
Comment at: tools/llvm-readobj/COFFDumper.cpp:567
@@ +566,3 @@
+  const data_directory *data;
+  Obj->getDataDirectory(index, data);
+  W.printHex(fieldName + "RVA", data->RelativeVirtualAddress);
----------------
You should check the error code here and skip it with a diagnostic. Also, upper camelcase for parameters and "data".

================
Comment at: lib/Object/COFFObjectFile.cpp:619
@@ +618,3 @@
+                                            const data_directory *&Res) const {
+  if (!DataDirectory || PE32Header->NumberOfRvaAndSize <= index)
+    return object_error::parse_failed;
----------------
Small nit, but the second check stumped me for a moment. The "subject" variable usually seems to come first in LLVM code.

================
Comment at: tools/llvm-readobj/COFFDumper.cpp:63
@@ -62,1 +62,3 @@
 
+  void printDataDirectory(uint32_t index, std::string fieldName);
+
----------------
Upper camelcase for the parameters.


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



More information about the llvm-commits mailing list