<div dir="ltr">I'm picking my battles in the interest of getting things done, Zach :-P</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 26, 2014 at 3:02 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I feel like relying on dead code elimination is a crutch to workaround an improperly layered set of libraries. It gets the job done with the least amount of programmer effort involved, but it might be worth at least brainstorming a better long-term solution and finding a way to split the libraries apart in such a way that llgs can bring in only the things it needs. Even if doing the actual split up front might be untenable due to time constraints or other factors, having a clear direction regarding an "end state" would perhaps allow new code to get fit into this model when it's written, and refactoring toward the end goal to happen gradually over time, as time permits.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Aug 26, 2014 at 12:21 PM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr">So here I *think* we want to do something that will let the linker dead code elimination be able to figure out which modules it doesn't need. Which means I think we really want the call graph for initializing the lighter apps (lldb-platform, lldb-gdbserver) to have a method they call which initializes the always-present items (i.e. the core). Then we can have the heavier apps (lldb) call the core initialization, then layer on the higher-level systems.<div>
<div><div>
<br></div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Todd Fiala</b> <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span><br>
Date: Tue, Aug 26, 2014 at 12:18 PM<br>Subject: Re: [Lldb-commits] [lldb] r216238 - Add missing HostInfo::Initialize() in llgs.<br>To: Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>><br>
Cc: Todd Fiala <<a href="mailto:todd.fiala@gmail.com" target="_blank">todd.fiala@gmail.com</a>>, lldb-commits <<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a>><br>
<br><br><div dir="ltr">Ok back looking at this for real.<div><br></div><div>So I'm going to need to adjust Debugger::Initalize() or use an alternative installation path. Right now it goes and calls lldb_private::Initialize(), which pretty much brings in the whole world. llgs needs to be *thin*, as we're counting on static linkage and dead code elimination to cut out the bulk of the exe size. There is a ton more stuff initialized in lldb_private::Initialize() than we need in llgs.</div>
<div><br></div><div>(e.g. ProcessLinux, DynamicLoader*, language runtimes, etc. --- none of those should be getting initialized in llgs).</div><div><br></div><div><br></div></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">
On Tue, Aug 26, 2014 at 11:52 AM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Ok - but - are we okay with moving PluginManager::Initialize() within there? If so, we're good. Because HostInfo::Initialize() needs to come *before* PluginManager::Initialize().<div><br></div><div>Seems reasonable, I just need to peek where we're initializing PluginManager.</div>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 26, 2014 at 11:51 AM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">then HostInfo::Initialize() should go first within Debugger::Initialize() and HostInfo::Terminate() should go last in Debugger::Terminate().<br>
<div><div><br>
> On Aug 26, 2014, at 11:46 AM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
><br>
> > But I think Debugger depends on HostInfo being initialized first.<br>
><br>
> Rather I meant:<br>
> * PluginManager::Initialize() requires HostInfo to already be initialized.<br>
> * Debugger::Initialize() expects PluginManager is already initialized.<br>
><br>
><br>
> On Tue, Aug 26, 2014 at 11:44 AM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
> There might be an issue there.<br>
><br>
> PluginManager uses the file system initialization. But I think Debugger depends on HostInfo being initialized first.<br>
><br>
> I'll look and see if I can detangle that.<br>
><br>
><br>
> On Tue, Aug 26, 2014 at 11:43 AM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>
> Ah ok. I'll move those in a minute. Another check-in coming shortly before.<br>
><br>
><br>
> On Tue, Aug 26, 2014 at 11:34 AM, Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br>
> Todd:<br>
><br>
> HostInfo::Intialize() should be done in Debugger::Initialize()<br>
> HostInfo::Terminate() should be done in Debugger::Terminate()<br>
><br>
> We want there to be single call to initialize everything and terminate everything and this is done via the Debugger calls.<br>
><br>
> > On Aug 21, 2014, at 3:41 PM, Todd Fiala <<a href="mailto:todd.fiala@gmail.com" target="_blank">todd.fiala@gmail.com</a>> wrote:<br>
> ><br>
> > Author: tfiala<br>
> > Date: Thu Aug 21 17:41:25 2014<br>
> > New Revision: 216238<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=216238&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=216238&view=rev</a><br>
> > Log:<br>
> > Add missing HostInfo::Initialize() in llgs.<br>
> ><br>
> > This fixes an llgs segfault on startup.<br>
> ><br>
> > Modified:<br>
> > lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp<br>
> ><br>
> > Modified: lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp?rev=216238&r1=216237&r2=216238&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp?rev=216238&r1=216237&r2=216238&view=diff</a><br>
> > ==============================================================================<br>
> > --- lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp (original)<br>
> > +++ lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp Thu Aug 21 17:41:25 2014<br>
> > @@ -32,6 +32,7 @@<br>
> > #include "lldb/Core/Debugger.h"<br>
> > #include "lldb/Core/PluginManager.h"<br>
> > #include "lldb/Core/StreamFile.h"<br>
> > +#include "lldb/Host/HostInfo.h"<br>
> > #include "lldb/Host/OptionParser.h"<br>
> > #include "lldb/Host/Socket.h"<br>
> > #include "lldb/Interpreter/CommandInterpreter.h"<br>
> > @@ -152,6 +153,7 @@ dump_available_platforms (FILE *output_f<br>
> > static void<br>
> > initialize_lldb_gdbserver ()<br>
> > {<br>
> > + HostInfo::Initialize ();<br>
> > PluginManager::Initialize ();<br>
> > Debugger::Initialize (NULL);<br>
> > }<br>
> > @@ -159,7 +161,7 @@ initialize_lldb_gdbserver ()<br>
> > static void<br>
> > terminate_lldb_gdbserver ()<br>
> > {<br>
> > - Debugger::Terminate();<br>
> > + Debugger::Terminate ();<br>
> > PluginManager::Terminate ();<br>
> > }<br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > lldb-commits mailing list<br>
> > <a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
><br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
><br>
><br>
><br>
> --<br>
> Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>
</div></div></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div></div></div></div>
<br></div></div>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>