<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 5, 2014, at 2:58 PM, Kuba Brecka <<a href="mailto:kuba.brecka@gmail.com" class="">kuba.brecka@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Will update the patch.<div class=""><br class=""></div><div class="">I don't have a strong opinion whether SBThreadCollection should or shouldn't be read-only. It seems to me its purpose of existence now is to allow SB API to return multiple SBThreads as a single return value. Can't think of any API that would be suitable to have a SBThreadCollection as an input (that the user would construct and populate). If you think we should allow it, I can add it.</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>It seems like you’re right that we don’t have any need for this now - I was mostly thinking along the lines of users being able to use an SBThreadCollection to store threads internally to their own scripts/programs; but in practice, I suppose Python has lists that can be used, and C++ has std::vector<SBThread> already for this purpose</div><div>So, no, I’d say, let’s leave it out for now - and if/when we need it, we can go ahead and make the collection mutable</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Kuba<div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Sep 5, 2014 at 2:35 PM, Enrico Granata <span dir="ltr" class=""><<a href="mailto:egranata@apple.com" target="_blank" class="">egranata@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Couple things:<div class=""><br class=""></div><div class="">- why do you need stdio.h in your header file?</div><div class=""><div class="">+#include <stdio.h></div></div><div class=""><br class=""></div><div class="">- is there any reason why this constructor is public?</div><div class=""><div class="">+ SBThreadCollection (const lldb::ThreadCollectionSP &thread_list);</div></div><div class=""><br class=""></div><div class="">We are usually trying to keep the constructors that take SP<i class="">s</i> protected so they are not exposed to API clients; unless you have a compelling reason, I’d do the same here</div><div class=""><br class=""></div><div class="">For instance, SBData has the following:</div><div class=""><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(187,44,162)" class="">protected<span style="" class="">:</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,0)" class=""><span style="" class=""> </span>// Mimic shared pointer...</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(79,129,135)" class=""><span style="" class=""> </span>lldb_private<span style="" class="">::</span>DataExtractor<span style="" class=""> *</span></div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""> get() <span style="color:rgb(187,44,162)" class="">const</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(79,129,135)" class=""><span style="" class=""> </span>lldb_private<span style="" class="">::</span>DataExtractor<span style="" class=""> *</span></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(187,44,162)" class=""><span style="" class=""> </span>operator<span style="" class="">->() </span>const<span style="" class="">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(79,129,135)" class=""><span style="" class=""> </span>lldb<span style="" class="">::</span>DataExtractorSP<span style="" class=""> &</span></div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""> <span style="color:rgb(187,44,162)" class="">operator</span>*();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""> <br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(79,129,135)" class=""><span style="" class=""> </span><span style="color:rgb(187,44,162)" class="">const</span><span style="" class=""> </span>lldb<span style="" class="">::</span>DataExtractorSP<span style="" class=""> &</span></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(187,44,162)" class=""><span style="" class=""> </span>operator<span style="" class="">*() </span>const<span style="" class="">;</span></div><div style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px" class=""><br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""> SBData (<span style="color:rgb(187,44,162)" class="">const</span> <span style="color:rgb(79,129,135)" class="">lldb</span>::<span style="color:rgb(79,129,135)" class="">DataExtractorSP</span> &data_sp);</div><div style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px" class=""><br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""> <span style="color:rgb(187,44,162)" class="">void</span></div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""> SetOpaque (<span style="color:rgb(187,44,162)" class="">const</span> <span style="color:rgb(79,129,135)" class="">lldb</span>::<span style="color:rgb(79,129,135)" class="">DataExtractorSP</span> &data_sp);</div></div><div class=""><br class=""></div><div class="">You could so something similar in your SBThreadCollection; provide protected accessors, constructor and setter, and only keep the default & copy constructors public</div><div class=""><br class=""></div><div class="">On a more philosophical note - is SBThreadCollection meant as a “read-only” snapshot of a set of threads as they existed at one time?</div><div class="">If so, then it’s all fine and dandy</div><div class="">But it seems that this class lacks any write access; I can’t create a new thread collection and start adding threads to it</div><div class="">Is this intended in your design, or did you just not feel the need to allow that?</div><div class="">Mostly curious..</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Sep 5, 2014, at 2:20 PM, Kuba Brecka <<a href="mailto:kuba.brecka@gmail.com" target="_blank" class="">kuba.brecka@gmail.com</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5">Another piece of the puzzle, let's expose the newly abstracted ThreadCollection into SB API, based on <a href="http://reviews.llvm.org/D5200" target="_blank" class="">http://reviews.llvm.org/D5200</a> and another patch that will actually provide an SBThreadCollection of ASan history threads is coming next.<br class=""><br class=""><a href="http://reviews.llvm.org/D5218" target="_blank" class="">http://reviews.llvm.org/D5218</a><br class=""><br class="">Files:<br class=""> include/lldb/API/SBDefines.h<br class=""> include/lldb/API/SBThreadCollection.h<br class=""> lldb.xcodeproj/project.pbxproj<br class=""> scripts/Python/build-swig-Python.sh<br class=""> scripts/Python/buildSwigPython.py<br class=""> scripts/Python/interface/SBThreadCollection.i<br class=""> scripts/lldb.swig<br class=""> source/API/SBThreadCollection.cpp<br class=""></div></div><span class=""><D5218.13339.patch></span>_______________________________________________<br class="">lldb-commits mailing list<br class=""><a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank" class="">lldb-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br class=""></div></blockquote></div><br class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div class="">Thanks,</div><div class=""><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div><div class=""><br class=""></div></div></div></div></div></div><br class=""><br class="">
</div>
<br class=""></div></div></blockquote></div><br class=""></div></div></div>
</div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks,</div><div class=""><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div><div class=""><br class=""></div></div></div></div></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>