[Lldb-commits] [lldb] [lldb] Start using formatv() in RegisterContextUnwind (NFCI) (PR #191576)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 13 08:49:06 PDT 2026


https://github.com/DavidSpickett commented:

I'm not sure of the history here but I'm starting to see why it might have been written this way, assuming that it is not just a historical artifact. And that reason is kinda like the comment you left about assuming that the log variable exists. These functions let you log without having to `GetLog` in some nearby place.

The benefit of that is small, so I suspect it was just a style decision at the time, and as you say:
> this makes log enable -F lldb unwind print the correct methods names from which the messages originate

I think that is reason enough to switch to the macros.

For the scope of the `GetLog(` calls, if the function is going to use it in a loop move it out, or if it uses it often put it at the top. Otherwise put it as close to first use as possible.

(can't be any worse than the logging functions, which are getting it on every call)

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


More information about the lldb-commits mailing list