<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">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. <div><br></div><div>I see a few potential solutions:</div><div><br></div><div><div>(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 least. </div></div><div><br></div><div>(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. </div><div><br></div><div>(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 view.</div><div><br></div><div>Of course I'm open to alternatives as well! </div><div><br></div><div>Cheers,</div><div>Jonas</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 3, 2018 at 9:31 AM Jonas Devlieghere via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL348152: [Reproducers] Change how reproducers are initialized. (authored by JDevlieghere, committed by ).<br>
Herald added a subscriber: llvm-commits.<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D55038?vs=176161&id=176418#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D55038?vs=176161&id=176418#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D55038/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D55038/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D55038" rel="noreferrer" target="_blank">https://reviews.llvm.org/D55038</a><br>
<br>
Files:<br>
  lldb/trunk/include/lldb/API/SBDebugger.h<br>
  lldb/trunk/include/lldb/API/SBDefines.h<br>
  lldb/trunk/include/lldb/API/SBFileSpec.h<br>
  lldb/trunk/include/lldb/API/SBInitializerOptions.h<br>
  lldb/trunk/include/lldb/Core/Debugger.h<br>
  lldb/trunk/include/lldb/Host/HostInfoBase.h<br>
  lldb/trunk/include/lldb/Initialization/SystemInitializer.h<br>
  lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h<br>
  lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h<br>
  lldb/trunk/include/lldb/Utility/Reproducer.h<br>
  lldb/trunk/lit/Reproducer/Inputs/GDBRemoteCapture.in<br>
  lldb/trunk/lit/Reproducer/Inputs/GDBRemoteReplay.in<br>
  lldb/trunk/lit/Reproducer/Inputs/simple.c<br>
  lldb/trunk/lit/Reproducer/TestDriverOptions.test<br>
  lldb/trunk/lit/Reproducer/TestGDBRemoteRepro.test<br>
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/Makefile<br>
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/TestGdbRemoteReproducer.py<br>
  lldb/trunk/scripts/interface/SBDebugger.i<br>
  lldb/trunk/scripts/interface/SBInitializerOptions.i<br>
  lldb/trunk/scripts/lldb.swig<br>
  lldb/trunk/source/API/CMakeLists.txt<br>
  lldb/trunk/source/API/SBDebugger.cpp<br>
  lldb/trunk/source/API/SBInitializerOptions.cpp<br>
  lldb/trunk/source/API/SystemInitializerFull.cpp<br>
  lldb/trunk/source/API/SystemInitializerFull.h<br>
  lldb/trunk/source/Commands/CommandObjectReproducer.cpp<br>
  lldb/trunk/source/Core/Debugger.cpp<br>
  lldb/trunk/source/Host/common/HostInfoBase.cpp<br>
  lldb/trunk/source/Initialization/SystemInitializerCommon.cpp<br>
  lldb/trunk/source/Initialization/SystemLifetimeManager.cpp<br>
  lldb/trunk/source/Utility/Reproducer.cpp<br>
  lldb/trunk/tools/driver/Driver.cpp<br>
  lldb/trunk/tools/driver/Options.td<br>
  lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp<br>
  lldb/trunk/tools/lldb-server/SystemInitializerLLGS.h<br>
  lldb/trunk/tools/lldb-server/lldb-server.cpp<br>
  lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp<br>
  lldb/trunk/tools/lldb-test/SystemInitializerTest.h<br>
  lldb/trunk/tools/lldb-test/lldb-test.cpp<br>
  lldb/trunk/unittests/Utility/ReproducerTest.cpp<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>