[llvm] [llvm-objdump] Fix output corruption when DWARF reg-name callback misses. (PR #200975)

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 08:29:20 PDT 2026


https://github.com/slinder1 commented:

Can we just fix the `GetReg` callback of `printDwarfExpressionCompact` to return `Expected<StringRef>`, and use `createStringError` for the failure case?

It should not have hidden side-effects to begin with, and just buffering side-effects to work around that doesn't seem great.

If we really can't change it for some backwards compat reason (I don't think it is a stable interface, so I think we should be fine to change it) then I would suggest deprecating it and making a new version that forbids the side-effects and gives a means to communicate failure explicitly

https://github.com/llvm/llvm-project/pull/200975


More information about the llvm-commits mailing list