<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Frame pointer omission (FPO) optimization and consequences when debugging, part 1</title>
	<atom:link href="http://www.nynaeve.net/index.php?feed=rss2&#038;p=91" rel="self" type="application/rss+xml" />
	<link>http://www.nynaeve.net/?p=91</link>
	<description>Adventures in Windows debugging and reverse engineering.</description>
	<lastBuildDate>Tue, 24 Aug 2010 12:05:39 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ksplice &#8212; safe enough? &#171; JP&#8217;s Blog</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-25982</link>
		<dc:creator>Ksplice &#8212; safe enough? &#171; JP&#8217;s Blog</dc:creator>
		<pubDate>Thu, 01 May 2008 08:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-25982</guid>
		<description>[...] on Windows, it is still a problem that cannot be easily dismissed. Finally, optimizations such as Frame Pointer Omission can thwart attempts to perform a stack walk by following the [...]</description>
		<content:encoded><![CDATA[<p>[...] on Windows, it is still a problem that cannot be easily dismissed. Finally, optimizations such as Frame Pointer Omission can thwart attempts to perform a stack walk by following the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Skywing</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-656</link>
		<dc:creator>Skywing</dc:creator>
		<pubDate>Thu, 07 Dec 2006 02:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-656</guid>
		<description>Vladimir: Try using &quot;/Oy-&quot;.  Also, I&#039;ve noticed that there are a lot of places where recent compilers (e.g. VS2005) will absolutely insist on using EBP when they don&#039;t really *need* to per-se, such as functions with array local variables.  So, you might have a bit of trouble in getting CL 14 / VS2005 to omit code to use EBP as a frame in some cases (i.e. forcing CL to use direct ESP accesses).</description>
		<content:encoded><![CDATA[<p>Vladimir: Try using &#8220;/Oy-&#8221;.  Also, I&#8217;ve noticed that there are a lot of places where recent compilers (e.g. VS2005) will absolutely insist on using EBP when they don&#8217;t really *need* to per-se, such as functions with array local variables.  So, you might have a bit of trouble in getting CL 14 / VS2005 to omit code to use EBP as a frame in some cases (i.e. forcing CL to use direct ESP accesses).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nynaeve &#187; Blog Archive &#187; Frame pointer omission (FPO) optimization and consequences when debugging, part 2</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-653</link>
		<dc:creator>Nynaeve &#187; Blog Archive &#187; Frame pointer omission (FPO) optimization and consequences when debugging, part 2</dc:creator>
		<pubDate>Wed, 06 Dec 2006 17:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-653</guid>
		<description>[...] Frame pointer omission (FPO) and consequences when debugging, part 1. [...]</description>
		<content:encoded><![CDATA[<p>[...] Frame pointer omission (FPO) and consequences when debugging, part 1. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir Scherbina</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-524</link>
		<dc:creator>Vladimir Scherbina</dc:creator>
		<pubDate>Thu, 23 Nov 2006 21:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-524</guid>
		<description>Skywing, 

Did you managed /Oy to work? I did some tests in past and they failed. 

Simple code that compares dword value with zero looks identical in both cases: when compiling with /Oy and w/o /Oy: (this is what I have in both cases)

 ; HRESULT DllCanUnloadNow(void)
.text:10005650                 public DllCanUnloadNow
.text:10005650 DllCanUnloadNow proc near
.text:10005650                 push    ebp
.text:10005651                 mov     ebp, esp
.text:10005653                 xor     eax, eax
.text:10005655                 cmp     dword_10010078, 0
.text:1000565C                 setnz   al
.text:1000565F                 pop     ebp
.text:10005660                 retn
.text:10005660 DllCanUnloadNow endp</description>
		<content:encoded><![CDATA[<p>Skywing, </p>
<p>Did you managed /Oy to work? I did some tests in past and they failed. </p>
<p>Simple code that compares dword value with zero looks identical in both cases: when compiling with /Oy and w/o /Oy: (this is what I have in both cases)</p>
<p> ; HRESULT DllCanUnloadNow(void)<br />
.text:10005650                 public DllCanUnloadNow<br />
.text:10005650 DllCanUnloadNow proc near<br />
.text:10005650                 push    ebp<br />
.text:10005651                 mov     ebp, esp<br />
.text:10005653                 xor     eax, eax<br />
.text:10005655                 cmp     dword_10010078, 0<br />
.text:1000565C                 setnz   al<br />
.text:1000565F                 pop     ebp<br />
.text:10005660                 retn<br />
.text:10005660 DllCanUnloadNow endp</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel Lebedinsky</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-503</link>
		<dc:creator>Pavel Lebedinsky</dc:creator>
		<pubDate>Wed, 22 Nov 2006 08:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-503</guid>
		<description>As of VS 2005, the default is to not invoke local destructors for SEH exceptions:

http://msdn2.microsoft.com/en-us/library/1deeycx5.aspx

/EHa still works but generally is not recommended.</description>
		<content:encoded><![CDATA[<p>As of VS 2005, the default is to not invoke local destructors for SEH exceptions:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/1deeycx5.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/1deeycx5.aspx</a></p>
<p>/EHa still works but generally is not recommended.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Skywing</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-500</link>
		<dc:creator>Skywing</dc:creator>
		<pubDate>Wed, 22 Nov 2006 05:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-500</guid>
		<description>No.  I would assume this is primarily because of their use in inline memcmp/strcmp/memcpy.</description>
		<content:encoded><![CDATA[<p>No.  I would assume this is primarily because of their use in inline memcmp/strcmp/memcpy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dispensa</title>
		<link>http://www.nynaeve.net/?p=91&#038;cpage=1#comment-499</link>
		<dc:creator>dispensa</dc:creator>
		<pubDate>Wed, 22 Nov 2006 05:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.nynaeve.net/?p=91#comment-499</guid>
		<description>&gt; The convention is to use the ebp register to access locals and stack arguments. Ebp is typically setup such that the first stack argument can be found at [ebp+08], with local variables typically at a negative displacement from ebp.

I think it&#039;s probably fair to say it&#039;s more than convention; ebp (== base pointer) is one of the few registers whose segment default is SS (the only other one being esp?). The rest reference DS or CS. 

I know it&#039;s not a problem on Windows, since the segments (other than FS/GS) all match, but in principle, these are implicit 48-bit addresses, and EDI, for example, can&#039;t be used to reference the stack without an override.

Now, with that completely theoretical assertion out of the way, do you run across a lot of generated code using register-indirect addressing into the stack with ESI/EDI/etc. as a base?</description>
		<content:encoded><![CDATA[<p>> The convention is to use the ebp register to access locals and stack arguments. Ebp is typically setup such that the first stack argument can be found at [ebp+08], with local variables typically at a negative displacement from ebp.</p>
<p>I think it&#8217;s probably fair to say it&#8217;s more than convention; ebp (== base pointer) is one of the few registers whose segment default is SS (the only other one being esp?). The rest reference DS or CS. </p>
<p>I know it&#8217;s not a problem on Windows, since the segments (other than FS/GS) all match, but in principle, these are implicit 48-bit addresses, and EDI, for example, can&#8217;t be used to reference the stack without an override.</p>
<p>Now, with that completely theoretical assertion out of the way, do you run across a lot of generated code using register-indirect addressing into the stack with ESI/EDI/etc. as a base?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.342 seconds -->
