[lldb-dev] [PATCH] For SBDebugger::Create assertion failure

Zachary Turner zturner at google.com
Wed Oct 8 13:26:12 PDT 2014


Want to say I agree with Greg on this one, but did want to answer one
question you had.

On Tue, Oct 7, 2014 at 10:15 PM, Matthew Gardiner <mg11 at csr.com> wrote:

> On Tue, 2014-10-07 at 17:10 -0700, Greg Clayton wrote:
> > It is quite common for shared libraries to have initialize and terminate
> calls. We have this in LLDB.
>
> Agreed. Lots of libraries have to initialise resource, then release the
> resource upon terminate.
>
> But why have an Initialise method when you _already_ have a Create
> method? Likewise a Terminate method when you _already_ have a Destroy
> method.
>
> Surely when a "thing" is created that is also when it is initialised?


Initialize() initializes global state that is a pre-requisite for using
*any* SBDebugger instance.  Create() creates a single instance of an
SBDebugger, assuming that the global state has already been initialized.
You can have multiple SBDebuggers, but you can only Initialize() once.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20141008/f473085e/attachment.html>


More information about the lldb-dev mailing list