[PATCH] First step towards PR21189 -- Teach llvm-readobj to dump bits of COFF symbol subsections required to debug using VS2012+

David Majnemer david.majnemer at gmail.com
Thu Oct 23 14:25:25 PDT 2014


================
Comment at: tools/llvm-readobj/COFFDumper.cpp:618
@@ +617,3 @@
+    // Read subsection segments one by one.
+    uint16_t Size = DE.getU16(&Offset);
+    // The section size includes the size of the type identifier.
----------------
You don't have a check to ensure that we can succeed in this `getU16` call.

================
Comment at: tools/llvm-readobj/COFFDumper.cpp:629
@@ +628,3 @@
+      DictScope S(W, "ProcStart");
+      if (InFunctionScope || Size < 36) {
+        error(object_error::parse_failed);
----------------
36 makes me think we didn't take into account `uint32_t CodeSize = DE.getU32(&Offset);`

================
Comment at: tools/llvm-readobj/COFFDumper.cpp:648
@@ +647,3 @@
+      StringRef FunctionName = DE.getCStr(&Offset);
+      if (!DE.isValidOffset(Offset)) {
+        error(object_error::parse_failed);
----------------
Is it not valid for the DataExtractor to be at the end of the file at this point?

http://reviews.llvm.org/D5755






More information about the llvm-commits mailing list