<div dir="ltr">Thanks, Greg!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 5, 2014 at 2:49 PM, 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">(lldb) script print lldb.SBDebugger.GetVersionString()<br>
<br>
You should be able to use that in your script to do something like:<br>
<br>
<br>
def __lldb_init_module (debugger, dict):<br>
version = lldb.SBDebugger.GetVersionString()<br>
if version contains '123':<br>
debugger.HandleCommand("do one thing")<br>
else<br>
debugger.HandleCommand("do another")<br>
<br>
Then you can save this somewhere and add a "command script import /path/to/initlldb.py" to your ~/.lldbinit file.<br>
<span class="HOEnZb"><font color="#888888"><br>
Greg<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> On Sep 5, 2014, at 1:52 PM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
><br>
> Ok. It might be possible to have a distribution bundle some kind of init that does this to manage side-by-side installations. I may bounce this idea around with Sylvestre and see if I can figure out how to make that work.<br>
><br>
><br>
> On Fri, Sep 5, 2014 at 12:52 PM, Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br>
> You will have to import a python module and check the lldb version from python to do any conditional stuff that is based on the LLDB version. There is nothing in the command interpreter (no flow control or conditionals).<br>
><br>
> Greg<br>
><br>
> > On Sep 4, 2014, at 9:25 AM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
> ><br>
> > Hi all,<br>
> ><br>
> > Do we have any existing way to handle conditionally making settings based on lldb version, within the .lldbinit system?<br>
> ><br>
> > The specific case I have in mind is helping support side-by-side lldb installs (e.g. on debian/ubuntu) where, across lldb 3.4, 3.5 and 3.6, the python path to the correct lldb python module differs. Right now, the default behavior is that lldb 3.5 and 3.6 are picking up the older 3.4 lldb python library and choking due to the mismatch.<br>
> ><br>
> > Thanks for any thoughts on this!<br>
> ><br>
> > -Todd<br>
> ><br>
> > _______________________________________________<br>
> > lldb-dev mailing list<br>
> > <a href="mailto:lldb-dev@cs.uiuc.edu">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>
><br>
><br>
><br>
> --<br>
> Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180">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>