<div dir="ltr">> <span style="font-family:arial,sans-serif;font-size:12.727272033691406px">- What is updateSectionLoadAddress(...) doing when it checks "if (section_sp->GetFileAddress() > 0x100000)"?</span><div>
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><font face="arial, sans-serif">LLVM allocates sections with relocations outside of the actual symbol file and then updates the section vmaddr accordingly. What this code does is basically traverse through the section tree and for every leaf section adjust the load address accordingly. The only problem is that LLVm doesn't actually relocate all sections, so we have to have some kind of check to determine whether the section was relocated or not. The condition in there right now is a stop gap and I'd like to come up with something more reasonable (I meant to ask about that in the initial review). I think some sort of comparison to the file size would be appropriate, but I don't know enough about Mach O object files to know about the relation of vmaddr and file offset. Any ideas?</font></div>
<div><font face="arial, sans-serif"><br></font></div><div>> <span style="font-family:arial,sans-serif;font-size:12.727272033691406px">- Why are we preloading everything with the code: ...</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Yes, you're right, that was for debugging and slipped past my cleanup.</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">> </span><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">- Your fix to ObjectFileMachO.cpp is not correct...</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><font face="arial, sans-serif">The code in if (process) doesn't do anything if we don't have a linkedit_section_sp. Maybe we need to duplicate that code in an else block for </font><span style="font-family:arial,sans-serif">linkedit_section_sp ... </span></div>
<div><span style="font-family:arial,sans-serif"><br></span></div><div>Thank you for your comments. I'm learning as I'm going here.</div><div><br></div><div>Keno</div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 12:37 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can you explain a few things?:<br>
<br>
- What is updateSectionLoadAddress(...) doing when it checks "if (section_sp->GetFileAddress() > 0x100000)"?<br>
- Why are we preloading everything with the code:<br>
<br>
// load the symbol table right away<br>
module_sp->GetObjectFile()->GetSymtab();<br>
<br>
module_sp->GetSymbolVendor()->GetNumCompileUnits();<br>
module_sp->GetSymbolVendor()->GetCompileUnitAtIndex(0);<br>
module_sp->ParseAllDebugSymbols();<br>
<br>
This seems like we should just let it load things lazily. Parsing all debug symbols is not advised, it should be allowed to lazily parse the DWARF as it needs to.<br>
<br>
- Your fix to ObjectFileMachO.cpp is not correct. If we have a process, then we load the symbol table from memory (the code in the "if (process)"), else we load it from the load commands (in the "else") and from the file itself. We don't want to always load the symbol table from the load commands as the symtab_load_command.symoff and symtab_load_command.stroff are not correct when a mach-o file is being read from memory.<br>
<div><div class="h5"><br>
<br>
<br>
> On Jun 3, 2014, at 9:46 AM, Keno Fischer <<a href="mailto:kfischer@college.harvard.edu">kfischer@college.harvard.edu</a>> wrote:<br>
><br>
> This is the LLDB side of <a href="http://reviews.llvm.org/D4005" target="_blank">http://reviews.llvm.org/D4005</a><br>
><br>
> <a href="http://reviews.llvm.org/D4006" target="_blank">http://reviews.llvm.org/D4006</a><br>
><br>
> Files:<br>
> lib/Makefile<br>
> source/Core/Section.cpp<br>
> source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp<br>
> source/Plugins/Makefile<br>
> source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp<br>
</div></div>> <D4006.10055.patch>_______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
</blockquote></div><br></div>