<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="">There isn’t necessarily A load address for an SBModule. After all, the different segments could load with different offsets. We usually list the offset of the __TEXT__ address as the load address - for instance in “image list", since if you are only interested in symbolication, that’s what you care about. But there isn’t just one load address.<div class=""><br class=""></div><div class="">Jim</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 29, 2016, at 2:02 PM, Jeffrey Tan <<a href="mailto:jeffrey.fudan@gmail.com" class="">jeffrey.fudan@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Btw: I did not find an API to retrieve the load address of the SBModule? This seems to be weird to me, did I miss anything?<div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 29, 2016 at 1:34 PM, Jeffrey Tan <span dir="ltr" class=""><<a href="mailto:jeffrey.fudan@gmail.com" target="_blank" class="">jeffrey.fudan@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">I see why I did not find them in the first place. These two APIs are not listed in the official doc:<div class=""><a href="http://lldb.llvm.org/python_reference/index.html" target="_blank" class="">http://lldb.llvm.org/python_reference/index.html</a><br class=""></div><div class=""><br class=""></div><div class="">Someone might want to add it.</div><div class=""><br class=""></div><div class="">Thanks</div><span class="HOEnZb"><font color="#888888" class=""><div class="">Jeffrey</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 29, 2016 at 11:59 AM, Jeffrey Tan <span dir="ltr" class=""><<a href="mailto:jeffrey.fudan@gmail.com" target="_blank" class="">jeffrey.fudan@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">This is very useful, thanks for the info!</div><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 29, 2016 at 10:36 AM, Jim Ingham <span dir="ltr" class=""><<a href="mailto:jingham@apple.com" target="_blank" class="">jingham@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Feb 27, 2016, at 8:34 PM, Jeffrey Tan via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">I am trying to listen for module/symbol load/unload events and display them in output UI so that debugger users can have a basic clue what is debugger busy doing while launching a big executable linking many shared libraries.</div><div class=""><br class=""></div><div class="">Questions:</div><div class="">1. I did not find an API to get current load/unload module during module events. I was expecting some static API like lldb.SBModule(or SBTarget).GetModuleFromEvent(SBEvent), but this does not exists. I tried to treat current PC's module as loading module in module load/unload events. But that does not work too(I think because process is not stopped in module load/unload events). Do I miss something here?<br class=""></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">From SBTarget.h:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)" class=""><span style="" class=""> </span><span style="color:#bb2ca2" class="">static</span><span style="" class=""> </span>uint32_t</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""> GetNumModulesFromEvent (<span style="color:#bb2ca2" class="">const</span> <span style="color:#4f8187" class="">lldb</span>::<span style="color:#4f8187" class="">SBEvent</span> &event);</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""><br class=""></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)" class=""><span style="" class=""> </span><span style="color:#bb2ca2" class="">static</span><span style="" class=""> </span>lldb<span style="" class="">::</span>SBModule</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""> GetModuleAtIndexFromEvent (<span style="color:#bb2ca2" class="">const</span> <span style="color:#703daa" class="">uint32_t</span> idx, <span style="color:#bb2ca2" class="">const</span> <span style="color:#4f8187" class="">lldb</span>::<span style="color:#4f8187" class="">SBEvent</span> &event);</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""><br class=""></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class="">Note, you can also cause the process to stop with modules are loaded with the setting:</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""><br class=""></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""><div style="margin:0px;line-height:normal" class="">target.process.stop-on-sharedlibrary-events</div><div style="margin:0px;line-height:normal" class=""><br class=""></div><div style="margin:0px;line-height:normal" class="">if that is more convenient for you.</div></div></div><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">2. Even though "image list" shows I have around 42 modules loaded in process, I only got two module load events. Why is that?</div></div></div></blockquote><div class=""><br class=""></div></span><div class="">On OS X the loader loads the closure of modules for whatever it is loading, and only stops and informs the debugger when this is all done. So it is quite usual to see only a few load events even though many modules get loaded.</div><span class=""><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">3. Even though I added lldb.SBTarget.eBroadcastBitSymbolsLoaded, there is no event of type eBroadcastBitSymbolsLoaded generated. Is it expected? Apparently I have the symbols next to the binary. </div></div></div></blockquote><div class=""><br class=""></div></span><div class="">That event gets sent when symbols are added to an already loaded module. It is so a UI will know to refresh the backtrace, local variables, source view, etc when code goes from having no symbols to having some symbols. Those actions are not needed if the library & its symbols get loaded simultaneously, so it isn’t sent in that case.</div><div class=""><br class=""></div><div class="">Jim</div><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><span class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">This is tested on mac OSX lldb.</div><div class=""><br class=""></div><div class="">Jeffrey</div></div></span>
_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>