<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 10, 2018, at 11:32 AM, Leonard Mosescu via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I'm looking at how the LLDB minidump reader creates the list of modules:<div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><font face="monospace, monospace" class=""><span style="white-space:pre;color:rgb(0,0,255)" class="">void</span><span style="white-space: pre;" class=""> </span><span style="white-space:pre;color:rgb(121,94,38)" class="">ProcessMinidump::ReadModuleList</span><span style="white-space: pre;" class="">() {</span></font><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><font face="monospace, monospace" class="">...</font></div></div></blockquote><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><font face="monospace, monospace" class=""><span style="" class="">    </span><span style="color:rgb(0,0,255)" class="">const</span><span style="" class=""> </span><span style="color:rgb(0,0,255)" class="">auto</span><span style="" class=""> file_spec </span><span style="" class="">=</span><span style="" class=""> </span><span style="color:rgb(121,94,38)" class="">FileSpec</span><span style="" class="">(name.</span><span style="color:rgb(121,94,38)" class="">getValue</span><span style="" class="">(), </span><span style="color:rgb(0,0,255)" class="">true</span><span style="" class="">);</span></font></div></div></div><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><font face="monospace, monospace" class=""><span style="" class="">    ModuleSpec module_spec </span><span style="" class="">=</span><span style="" class=""> file_spec;</span></font></div></div></div><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><span style="" class=""><font face="monospace, monospace" class="">    Status error;</font></span></div></div></div><div class=""><div style="font-weight: normal; line-height: 18px; white-space: pre;" class=""><div style="" class=""><font face="monospace, monospace" style="" class=""><span style="" class=""><span style="background-color:rgb(255,255,255)" class="">    </span><span style="background-color:rgb(255,242,204)" class="">lldb::ModuleSP module_sp </span></span><span style="background-color:rgb(255,242,204)" class=""><span style="" class="">=</span><span style="" class=""> </span><span style="color:rgb(121,94,38)" class="">GetTarget</span><span style="" class="">().</span><span style="color:rgb(121,94,38)" class="">GetSharedModule</span><span style="" class="">(module_spec, </span><span style="" class="">&</span><span style="" class="">error);</span></span></font></div></div></div><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><font face="monospace, monospace" class=""><span style="" class="">    </span><span style="color:rgb(175,0,219)" class="">if</span><span style="" class=""> (</span><span style="" class="">!</span><span style="" class="">module_sp </span><span style="" class="">||</span><span style="" class=""> error.</span><span style="color:rgb(121,94,38)" class="">Fail</span><span style="" class="">()) {</span></font></div></div></div><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><font face="monospace, monospace" class=""><span style="" class="">      </span><span style="color:rgb(175,0,219)" class="">continue</span><span style="" class="">;</span></font></div></div></div><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><span style="" class=""><font face="monospace, monospace" class="">    }</font></span></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div class=""><span style="" class=""><font face="monospace, monospace" class="">...</font></span></div></div></div></blockquote><div class=""><div style="background-color: rgb(255, 255, 255); font-weight: normal; line-height: 18px; white-space: pre;" class=""><div style="" class=""><font face="monospace, monospace" class="">}</font></div></div></div></blockquote><div class=""><div style="background-color: rgb(255, 255, 255); font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-weight: normal; font-size: 13px; line-height: 18px; white-space: pre;" class=""><div class=""></div></div></div><div class=""><br class=""></div><div class="">LLDB currently will insist on finding a local image for the module, which is usually not the case for postmortem debugging on machines different than the the the one where the minidump was created.</div><div class=""><br class=""></div><div class="">I don't see an obvious way to model modules which have no local image (which is still different than the remote scenario where there is a remote module image), am I missing anything?<br class=""></div></div></div></blockquote><div><br class=""></div>The lldb_private::Platform is responsible for digging up any binaries for a given target, so this code should be grabbing the platform from the target and using that to get the shared module. That way if you create a target that is a minidump on a different system (macOS, linux, etc), the platform would be remote-windows. </div><div><br class=""></div><div>That being said "ModuleSpec" should be filled in with more than just the path. It should specify the UUID info from the mini dump that specifies exactly which version the file that you want. That way if the file on the current system exists, it won't return it unless the path matches. I assume the mini dump has each module's UUID information? If so, set it. If not the file format assumes you will be running the dumping the same machine and it should be updated to include this information. The platform code can then use this UUID info to possible go and fetch the right version from a UUID database, or how ever the platform wants to provide access to certain binaries. At Apple, we call "dsymForUUID <UUID>" which, if global defaults were set to point at Apple's build servers, would go out and download the correct file for us and store it locally in a cache for future use.</div><div><br class=""></div><div>So fill in the UUID in ModuleSpec and modify the Platform::GetSharedModule() for your platform to do the right thing is the correct way to go. ProcessMinidump should switch over to using the Platform::GetSharedModule() instead of the target one, or use it after the target one if the target returns an invalid module.</div><div><br class=""></div><div>Let me know if you have any more questions,</div><div><br class=""></div><div>Greg</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Lemo.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>
_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<br class=""></div></blockquote></div><br class=""></body></html>