[Lldb-commits] [PATCH] D55038: [Reproducers] Change how reproducers are initialized.
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 19 11:31:21 PST 2019
I think we'll need to reconsider this in light of the SBReproducers. The
Initialize method causes a bootstrapping problem, where we try to record
the Initialize call before the reproducer is initialized. Not recording the
initialization call isn't sufficient to solve this and in addition would
cause incorrectness in the logic that tracks API boundaries. This isn't
limited to the Initialized method, but also applies to
the SBInitializerOptions class.
I see a few potential solutions:
(1) Return a default-initialized reproducer when we try to obtain the
reproducer from the record macros before initialization. This would mean
we'd have to allow the reproducer to be re-initialized, potentially guarded
by a variable so that limits this to the aforementioned
(default-constructed) instance. This will create an imbalance, where
nothing before the initialization is recorded, but things after are. I'm
not sure if this actually causes a problem, but it feels hacky to say the
(2) Introduce a static variable that says that we're currently in the
initialization phase. When the variable is set we make the record macro a
no-op. This would mean adding more code to the macro expansion. In order to
guarantee symmetry during the initialization process we'd have to set and
unset it before and after the initialize call respectively. These two new
function calls would not be instrumented and guarantee to not call any
other SB method.
(3) Go back to initializing the reproducer before the rest of the debugger.
The method wouldn't be instrumented and guarantee no other SB methods are
called or SB objects are constructed. The initialization then becomes part
of the replay. Although it's more work and basically means undoing the
changes in this patch, I think it's the cleanest from a design point of
Of course I'm open to alternatives as well!
On Mon, Dec 3, 2018 at 9:31 AM Jonas Devlieghere via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL348152: [Reproducers] Change how reproducers are
> initialized. (authored by JDevlieghere, committed by ).
> Herald added a subscriber: llvm-commits.
> Changed prior to commit:
> rL LLVM
> CHANGES SINCE LAST ACTION
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-commits