<div dir="ltr">Hi Javier,<div><br></div><div><b>Frame layout:</b> See CoInterpreter>>initializeFrameIndices method code and comment which describe frame layout and provide correct indices.<div><br></div><div><b>Shape of the code:</b> I assume you're talking about shape of machine code version of methods/blocks. This is described in the CogMethod class comment. </div><div><br></div><div>To detect where a method starts and ends:</div><div>- the compiled method / compiled block in the heap has a pointer to the cog method in the code zone.</div><div>- from the cog method pointer, you've got a fixed offset to the entries to start executing machine code. See entryOffset / noCheckEntryOffset instance variables in Cogit class comment, note that in 32 bits I believe there's a jump back for Smi/Char in the entries so executable code actually starts before the entry and there's no reference to exactly where it starts (we have references only to places that can be called).</div><div>- from the cog method pointer, you can read in the header the block size to know where executable code stops and map for mcpc - bcpc debugging starts (See Cogit>>mapStartFor:, executable ends at cog method pointer + block size - 1)</div><div><br></div><div>Have fun :-)</div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 14, 2018 at 3:32 PM, Javier Pimás <span dir="ltr"><<a href="mailto:elpochodelagente@gmail.com" target="_blank">elpochodelagente@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr">For debugging aid, I'd like to know if there is any cheatsheet with things like frame layout in the native stack (offset of the compiled method, the receiver, temporaries) and shape of the code (i.e. how to detect where a method starts and ends). <div><br></div><div>Cheers,</div><div>Pocho<br clear="all"><div><br></div>-- <br><div class="gmail-m_-7025672014444116673gmail_signature"><div dir="ltr">Javier Pimás<br>Ciudad de Buenos Aires</div></div>
</div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><span style="font-size:12.8px">Clément Béra</span><div style="font-size:12.8px">Pharo consortium engineer</div><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.com/</a><br></div><div style="font-size:12.8px"><span style="line-height:16px">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight:bold;line-height:16px">Villeneuve d'Ascq</span></div></div></div>
</div></div></div></div>