[Lldb-commits] [PATCH] D119009: [Support] Ensure handlers are set up before printing the stacktrace

Andy Yankovsky via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 7 12:45:45 PST 2022


werat added a comment.

In D119009#3302354 <https://reviews.llvm.org/D119009#3302354>, @JDevlieghere wrote:

> I believe it's generally considered bad practice to install signal handlers in a library. This is why the initialization currently happens in the driver. If you look at other tools in LLVM you'll notice they do the same thing.
>
> Can we address this issue by (1) making sure we don't crash in lldbassert when calling `PrintStackTrace` without having initialized the signal handlers and (2) providing the ability to install the signal handlers through the SB API (if that doesn't already exist) if the user of libLLDB wants this functionality?

I agree, this approach makes perfect sense to me. I've sent (1) as a separate patch -- https://reviews.llvm.org/D119181. Didn't want to modify this one further to preserve the discussion and the original commit message.
I will look into (2) a bit later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119009



More information about the lldb-commits mailing list