werat added a comment.

In D119009#3297591 <https://reviews.llvm.org/D119009#3297591>, @aganea wrote:

> I'm not sure it's a good idea to start loading DLLs when we get to this point.
> I would rather suggest calling `sys::PrintStackTraceOnErrorSignal({});` in 
> `SBDebugger::Initialize()`. "argv0" will be auto-detected if necessary, 
> otherwise if you can, change the `SBDebugger::Initialize()` API to pass it? 
> It's only there so that we can find `llvm-symbolizer` next to the running 
> executable.

Thanks for a quick review! I followed your adviced and added a call to 
`PrintStackTraceOnErrorSignal()` in `Debugger::Initialize()`. It's possible to 
change the API to accept `argv` is possible, but it we can't introduce breaking 
changes, so the old code will not have `argv`.

Given that now PrintStackTraceOnErrorSignal will be called twice in LLDB driver 
(and in general case `Initialize()` can be called many times), I modified the 
implementation of `PrintStackTraceOnErrorSignal` a little bit -- don't do 
anything if `::Argv0` is already set.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119009

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to