[PATCH] D73086: [WIP][DWARF5] Added support for debug_macro section parsing and dumping in llvm-dwarfdump.

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 04:30:20 PDT 2020


SouraVX added a comment.

> Using the RecoverableErrorHandler allows programs to either continue or stop depending on the library client, and seems to be a good fit here. I haven't yet had a chance to look at the whole thing to be certain, but in general we should avoid directly reporting errors within library code, and instead use handlers or return llvm::Error/Expected to provide the error information back up the pile.

Thanks for this!

> You may want to consider whether there are cases where it makes sense to keep parsing within the section, even if something goes wrong. In that case, you'll need to pass the handler down the stack, call it, and then continue parsing.

The cases covered here are mostly in which parsing can't continue(DWARF64 present, opcode_operand_table present), however their is a case a field `debug_line_offset` is optional that is also correctly handled while parsing and dumping.

> If you're interested more in the topic, I did a lightning talk on it a couple of years ago, in relation to some older work I did in the .debug_line code. See https://www.youtube.com/watch?v=YSEY4pg1YB0 for the video.

Thanks for sharing this, this is very useful in present context!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73086/new/

https://reviews.llvm.org/D73086





More information about the llvm-commits mailing list