[Lldb-commits] [PATCH] D54460: Don't keep a global ABI plugin per architecture

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 12 18:15:54 PST 2018

zturner added a comment.

> If there were ever anything per-process that effected the ABI plugin's behavior (for instance if it relied on a Process property) you could very well use the wrong processes setting. Even worse, since the ABI's hold onto a process through a weak pointer, if the initial process had gone away, you would not be able to get to any process at all, and silently fall back on some default behavior.

This sounds like something testable.  Start a process, force an operation that goes through the ABI, kill the process, start a new one, do the same thing again.  Presumably this crashes in current LLDB?  Maybe this makes for a good test case?

BTW, as a general rule of thumb, `std::make_shared<T>(constructor_args)` is preferred over `shared_ptr<T>(new T(constructor_args));` unless it's impossible (the only time being where a constructor is private or protected).  The biggest reason is that it's every so slightly more efficient.  This usually doesn't matter, but it's one of those "well, why not?" kinda things.  Feel free to use the current syntax though, just pointing it out in case it strikes your fancy.



More information about the lldb-commits mailing list