[PATCH] D44560: [DWARF] Rework debug line parsing to use llvm::Error and callbacks

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 03:24:13 PDT 2018


jhenderson added a comment.

In https://reviews.llvm.org/D44560#1049021, @JDevlieghere wrote:

> Do you mean registering some kind of error handler in the dwarf context? I guess that sounds reasonable if it’s not too intrusive. We could provide a default implementation that simply prints “warning” and “error” so that the behavior remains unchanged initially. If we decide this is the way to go it should definitely go into a separate diff.


Yes, that's what I mean. Not sure about the default implementation, since at least for debug line, we never "error" in the sense of printing an error and returning exit code 1 on termination, but it should be easy to do either way.

> As the error handling for line tables is significantly different,, I see no harm in having a dedicated signature for the callback in the error handler. Based on the layering I expect we don’t have access to the co text in the parser? If anything I’d prefer not to clutter the interface too much, and directly use the context’s error handler from the parser, if at all possible.

Do you mean "context" in the parser (as opposed to "co text")? Because, we do actually have it, looking at the parse signatures, so we could call it directly, if we wanted (and I see no reason not to).

>> I'd appreciate some feedback from people on which approach seems the best, both in terms of registering the callback(s), and in handling errors that prevent further section parsing (as opposed to further table parsing).
> 
> I’m currently on vacation but I’ll be able to give some more in-depth feedback early next week.

No problem. I'm going to try experimenting with the context-based error handler a little in the meantime, and will upload another diff to present it, if I have enough time by the end of the week. FYI, I'm away on annual leave myself from Friday until Euro LLVM, so won't be reading emails until I'm back in the office (will you be around at the conference?).


Repository:
  rL LLVM

https://reviews.llvm.org/D44560





More information about the llvm-commits mailing list