Note that this doesn't go quite far enough. In a subsequent patch I will convert the symbol dumper to a visitor pattern, and move this into libcodeview just like CVTypeDumper. For now, this is the first step towards that, and a proof of concept that the RecordIterator is generic enough to handle more than just types.
Diff Detail
Event Timeline
So, while llvm-readobj may not have error handling, it *does* have very careful bounds checking, and I really want to keep it. This was an important part of our refactor away from DataExtractor to StringRef / consumeObject.
include/llvm/DebugInfo/CodeView/RecordIterator.h | ||
---|---|---|
35 | This also loses the bounds checking we had before. | |
include/llvm/DebugInfo/CodeView/SymbolRecord.h | ||
57 | Please don't do this, the old code was very careful to avoid buffer overruns when the string was not null terminated. It also throws off consumeObject, which will consume one extra byte, so SymData / LeafData won't hold the full string. | |
tools/llvm-readobj/COFFDumper.cpp | ||
1019 | If there is no terminating nul, split('\0') would give you all of SymData. I think that's the best behavior we can hope for. |
This also loses the bounds checking we had before.