<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 Feb 6, 2018, at 3:31 AM, Leandro <<a href="mailto:leandro.lupori@gmail.com" class="">leandro.lupori@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class="">Ok, so we should mark the global entry point as a trampoline by setting the symbol type to lldb::eSymbolTypeTrampoline, right?<br class=""></div></div></div></div></div></blockquote><div><br class=""></div>If there isn't ever anything useful to debug in the global entry point, then yes.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><br class=""></div>For ELF files, this seems to be done in ObjectFileELF.cpp, ParseTrampolineSymbols.<br class=""></div></div></div></div></blockquote><div><br class=""></div>It can also be during the normal symbol table parsing if you know that a symbol is a global entry point for PPC. You don't have to wait to set the symbol table until ParseTrampolineSymbols, so feel free to set the "symbol_type" correctly in ObjectFileELF::ParseSymbols().</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">But as this change will be specific to ppc64, and the local entry point is encoded in the "other" field of the function symbol itself, where would be the best place to insert this new code?<br class=""></div>Maybe a new conditional arch-specific step in ObjectFileELF::ParseSymbols, similar to those of ARM and MIPS?<br class=""></div></div></blockquote><div><br class=""></div>Yes you are on the right track. Any info you can glean from the symbol itself can be parsed in ObjectFileELF::ParseSymbols().</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><br class=""></div><div class="gmail_extra">- Leandro<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 5, 2018 at 4:03 PM, 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">As long as the prologue computation is done correctly we won't ever stop at the global entry point separately from the local one.  The will - after prologue skipping - resolve to the same address, and both stepping and breakpoint setting skip to the prologue unless you explicitly tell them not to.  So while I see the formal niceness of calling this a prologue, I don't think it is necessary.<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
Jim<br class="">
</font></span><div class="HOEnZb"><div class="h5"><br class="">
<br class="">
> On Feb 3, 2018, at 3:38 AM, Leandro Lupori via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>> wrote:<br class="">
><br class="">
> luporl added a comment.<br class="">
><br class="">
>> if you have a global entry point, is there ever any reason to stop at these? Is there anything you can debug in the global entry point?<br class="">
><br class="">
> You can look at it as part of the prologue. You'll want to debug it only if you want to debug the prologue.<br class="">
><br class="">
>> Does a global entry point always forward on to a local entry point?<br class="">
><br class="">
> When there are 2 entry points, yes, the global entry point always forwards to the local entry point.<br class="">
><br class="">
>> Does the local entry point always exists and is it the only thing that can be debugged?<br class="">
><br class="">
> Some functions may have only one entry point, be it local or global. If you don't want to debug the prologue, you will actually want to skip some bytes past the local entry point, to get past the prologue, to code that can be debugged.<br class="">
><br class="">
> Overall you can look at the local entry point as a kind of optimization, that enables a local call to skip part of the prologue.<br class="">
><br class="">
><br class="">
> <a href="https://reviews.llvm.org/D42582" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/<wbr class="">D42582</a><br class="">
><br class="">
><br class="">
><br class="">
<br class="">
</div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>