[PATCH] First step towards PR21189 -- Teach llvm-readobj to dump bits of COFF symbol subsections required to debug using VS2012+
Timur Iskhodzhanov
timurrrr at google.com
Thu Oct 23 14:45:02 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.
----------------
majnemer wrote:
> You don't have a check to ensure that we can succeed in this `getU16` call.
Per offline discussion: the check at line 620 is enough.
================
Comment at: tools/llvm-readobj/COFFDumper.cpp:629
@@ +628,3 @@
+ DictScope S(W, "ProcStart");
+ if (InFunctionScope || Size < 36) {
+ error(object_error::parse_failed);
----------------
majnemer wrote:
> 36 makes me think we didn't take into account `uint32_t CodeSize = DE.getU32(&Offset);`
Per offline discussion: 12+4+12+4+3+1 seems to be 36
================
Comment at: tools/llvm-readobj/COFFDumper.cpp:648
@@ +647,3 @@
+ StringRef FunctionName = DE.getCStr(&Offset);
+ if (!DE.isValidOffset(Offset)) {
+ error(object_error::parse_failed);
----------------
majnemer wrote:
> Is it not valid for the DataExtractor to be at the end of the file at this point?
It isn't, see line 673.
http://reviews.llvm.org/D5755
More information about the llvm-commits
mailing list