<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Apr 26, 2017 at 11:43 AM Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Adding Quentin here...<br><br><div class="gmail_quote"></div></div><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Apr 26, 2017 at 11:31 AM Carlo Kok <<a href="mailto:ck@remobjects.com" target="_blank">ck@remobjects.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 2017-04-26 19:56, Eric Christopher wrote:<br>
> That's really weird. I'm quite surprised that the entry block was moved<br>
> so much later in the function but haven't had a chance to look more at<br>
> it. Probably want to take a look and find out where that's happening and<br>
> why.<br>
<br>
From irc, thegameg helped me find the -enable-shrink-wrap=false, which<br>
"fixes" this, although this option doesn't seem to have a switch from<br>
code, only from the llc command line.<br>
<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>This is a good point. I've not overly thought about how shrink wrapping is going to correlate with entry/exit blocks and prologues. That said, the whole point of shrink wrapping is that the stack adjustments are hidden.</div><div><br></div><div>I'd have to page in that code to make more than a hand wavy "here's how you'll fix this" though. More thoughts right below though...</div></div></div><div dir="ltr"><div class="gmail_quote"><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Unless I'm missing something obvious, this will always screw up debug<br>
info on Windows 32bits.<br>
<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>It's pretty much everywhere and just means that the debugger will have some weird state until you actually hit that point. in the code. The problem is that you probably want the debugger to stop at the "beginning" of the function, but with shrink wrapping you won't have stack adjustments at all for that code and if you wait and put the prologue end at the end of the "stack adjustments" then you likely won't stop at all in the function.</div><div><br></div><div>Tricky.</div><div><br></div><div>At the moment I'm inclined to believe that this is "correct", but that we really need a better way of distinguishing these entry points.</div><div><br></div><div>Adrian/Dave: Any other ideas here?</div></div></div></blockquote><div><br>My guess (& this is more a "if someone wants to write patches for this, this is the direction I'd suggest" - since it's not a priority for me to do this work) would be that once the prologue is sunk beneath instructions with other debugloc lines (I think the current theory is that prologue locations have no debugloc at all - so basically as soon as you hit any debugloc) - it's no longer really the prologue. At that point emit the DWARF prologue - describe the value of parameters based on where they are at that point (registers, stack offsets, etc) and if you later reach a prologue that stuffs the values into stack, etc - emit a new location for the variables at that point.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>-eric</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The check in code to enable this calls:<br>
<br>
<br>
bool usesWindowsCFI() const {<br>
return ExceptionsType == ExceptionHandling::WinEH &&<br>
(WinEHEncodingType != WinEH::EncodingType::Invalid &&<br>
WinEHEncodingType != WinEH::EncodingType::X86);<br>
}<br>
<br>
Where EncodingType::X86: //Windows x86, uses no CFI, just EH tables<br>
<br>
The comment seems to imply there are EH tables for i386 Windows, however<br>
I can't find them.<br>
<br>
--<br>
Carlo Kok<br>
RemObjects Software<br>
</blockquote></div></div></blockquote></div></div>