<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=""><div class="">I think I mentioned that I was not sure SBValue was the best place to place this functionality (it’s address based, not ValueObject based), but it looked like others on the team felt differently, so no big deal there</div><div class=""><br class=""></div><div class="">One thing that worries me a little bit more is how the history threads are being stored on the ValueImpl - I am not sure I agree with that</div><div class=""><br class=""></div><div class="">The ValueImpl is essentially a way to reconstruct the underlying ValueObject for an SBValue given choices on dynamic/synthetic values; I could see us adding more axes to that class if we ended up with more features that could potentially generate different “views” of the same underlying root ValueObject</div><div class=""><br class=""></div><div class="">However, a HistoryThreads hardly seems to fit in there - I am assuming this is mostly because:</div><div class="">- this is a pointer-based lookup, so it makes little sense on the ValueObject proper</div><div class="">- but you still want to store it away somewhere once you computed it</div><div class=""><br class=""></div><div class="">I admit not having followed through your previous patch in depth, so take my suggestion with a grain of salt.. couldn’t your MemoryHistory plugin handle the caching? i.e. all I would ever do when asked for a HistoryThreadsSP is plugin->GetHistoryThreads(pointer_value); and the plugin would internally handle a per-process cache of pointer_value —> thread list</div><div class=""><br class=""></div><div class="">The advantage is that now the question could be asked from anywhere; I could ask it of an internal ValueObject, or of an SBValue, and the right thing would happen consistently (w.r.t. caching and whatnot) because now the plugin is handling this in a sane manner</div><div class=""><br class=""></div><div class="">This last one is minor but,</div><div class=""><div class="">+typedef std::shared_ptr<HistoryThreads> HistoryThreadsSP;</div><div class="">+</div></div><div class=""><br class=""></div><div class="">why do you need to define this in SBValue.cpp?</div><div class="">Can’t HistoryThreadsSP be defined with all the other FooSP typedefs, so it’s visible everywhere?</div><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 3, 2014, at 11:41 AM, Kuba Brecka <<a href="mailto:kuba.brecka@gmail.com" class="">kuba.brecka@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">This patch depends on <a href="http://reviews.llvm.org/D4596" class="">http://reviews.llvm.org/D4596</a>.<br class=""><br class="">As a continuation of the previous patch that adds a MemoryHistory plugin and implementation for ASan-provided malloc/free stack traces, this patch exposes this into the SB API. In short, these two new methods are added into SBValue:<br class=""><br class="">* uint32_t SBValue::GetNumMemoryHistoryThreads ();<br class="">* SBThread SBValue::GetMemoryHistoryThreadAtIndex (uint32_t idx);<br class=""><br class="">This corresponds to how we provide objects for which we don't have containers (SBFrame and GetNumFrames + GetFrameAtIndex). Note that exposing ThreadList into a generic SBThreadList container would not be straightforward, because currently ThreadList is not a generic container of threads, but instead holds functionality tied to a process and can currently only be used to hold all threads in a process.<br class=""><br class=""><a href="http://reviews.llvm.org/D5175" class="">http://reviews.llvm.org/D5175</a><br class=""><br class="">Files:<br class="">  include/lldb/API/SBValue.h<br class="">  scripts/Python/interface/SBValue.i<br class="">  source/API/SBValue.cpp<br class="">  test/functionalities/asan/TestAsan.py<br class=""><span id="cid:6F27984E-5B34-4D96-B23F-A4953ED2C595@apple.com"><D5175.13219.patch></span>_______________________________________________<br class="">lldb-commits mailing list<br class="">lldb-commits@cs.uiuc.edu<br class="">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits<br class=""></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>