<div dir="ltr">For better or worse you need to make a separate function.  An alternative idea that has been floated is to start making a version 2 SB API and then eventually deprecate the current API, but probably due to the amount of work involved and the cost/benefit ratio, nobody's ever really taken point on it.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 8, 2018 at 12:54 PM Leonard Mosescu via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="line-height:18px"><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">What is the governing</span> <span style="white-space:pre-wrap">philosophy around making changes to the SB API? The "</span></font></span><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><a href="http://lldb.llvm.org/SB-api-coding-rules.html" style="white-space:pre-wrap" target="_blank">SB API Coding Rules</a><span style="white-space:pre-wrap">"</span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">page establishes the practices on how to avoid introducing accidental incompatibility, but what </span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">about the cases where there's a case for intentionally making changes?</span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">For example, </span></font><span style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap">I'd like to make a small change to SBTarget to allow surfacing errors during LoadCore():</span></div><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="font-weight:normal;color:rgb(0,0,0)"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></span></span></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="line-height:18px"><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="font-weight:normal;color:rgb(0,0,0)"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">SBProcess </span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;color:rgb(121,94,38)">SBTarget::LoadCore</span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">(</span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;color:rgb(0,0,255)">const</span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> </span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;color:rgb(0,0,255)">char</span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> </span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">*</span><span style="font-size:small;font-weight:400;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">core_file</span><span style="font-size:small;font-weight:400;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">)</span></span></div></div></blockquote><div style="line-height:18px"><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="font-weight:normal;color:rgb(0,0,0)"><br></span></div><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="font-weight:normal;color:rgb(0,0,0)">And add an explicit out error parameter (in line with SBTarget::Attach(), Launch(), ...):</span></div><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="font-weight:normal;color:rgb(0,0,0)"><br class="m_-7614387339204897482gmail-Apple-interchange-newline"></span></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="line-height:18px"><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="font-weight:normal;color:rgb(0,0,0)">SBProcess </span><span style="font-weight:normal;color:rgb(121,94,38)">SBTarget::LoadCore</span><span style="font-weight:normal;color:rgb(0,0,0)">(</span><span style="font-weight:normal;color:rgb(0,0,255)">const</span><span style="font-weight:normal;color:rgb(0,0,0)"> </span><span style="font-weight:normal;color:rgb(0,0,255)">char</span><span style="font-weight:normal;color:rgb(0,0,0)"> </span><span style="font-weight:normal;color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">core_file<b>, SBError </b></span><span style="color:rgb(0,0,0)"><b>&</b></span><span style="color:rgb(0,0,0)"><b>error</b>)</span></div><div style="color:rgb(0,0,0);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";white-space:pre-wrap"><span style="color:rgb(0,0,0)"><br></span></div></div></blockquote><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">If the rule is to strictly avoid any kind of changes then I'd have to resort to</span></font><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">a COM-like versioning and introduce a new SBTarget::LoadCore2 (or LoadCoreEx, ... pick</span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">your poison, I'm not set on any name) while also keeping the existing LoadCore().</span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap">Any guidance on this? Thanks!</span></font><br><div><font color="#000000" face="Droid Sans Mono, monospace, monospace, Droid Sans Fallback"><span style="white-space:pre-wrap"><br></span></font><br></div></div></div>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>