<?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: Working with Delphi&#8217;s new Exception.StackTrace</title>
	<atom:link href="http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/</link>
	<description>Our products, programming &#38; business.</description>
	<lastBuildDate>Tue, 09 Feb 2010 18:35:10 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pierre-Fr. Culand</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-57353</link>
		<dc:creator>Pierre-Fr. Culand</dc:creator>
		<pubDate>Thu, 04 Feb 2010 11:16:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-57353</guid>
		<description>Hi Tobias,

Thank you for your answer.

Actually, I have to admit that my question was a bit stupid... :-o
I noticed just after having posted that the answers to my questions were already in the examples of the JCL...

(in stacktrack and threadexcept examples)

I have now a fantastic tool to debug my multithreaded Delphi 6 application ! Whatever the unhandled exception is raised in the main VCL thread or in one of my other threads...

Thank you for your answer anyway.</description>
		<content:encoded><![CDATA[<p>Hi Tobias,</p>
<p>Thank you for your answer.</p>
<p>Actually, I have to admit that my question was a bit stupid&#8230; <img src='http://blog.gurock.com/wp-includes/images/smilies/icon_surprised.gif' alt=':-o' class='wp-smiley' /><br />
I noticed just after having posted that the answers to my questions were already in the examples of the JCL&#8230;</p>
<p>(in stacktrack and threadexcept examples)</p>
<p>I have now a fantastic tool to debug my multithreaded Delphi 6 application ! Whatever the unhandled exception is raised in the main VCL thread or in one of my other threads&#8230;</p>
<p>Thank you for your answer anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias Gurock</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-57343</link>
		<dc:creator>Tobias Gurock</dc:creator>
		<pubDate>Thu, 04 Feb 2010 09:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-57343</guid>
		<description>Hello Pierre-François,

In the SmartInspect Console (standard forms application), we are calling JclLastExceptStackListToStrings in the application exception event to show/log/handle unhandled exceptions. Not sure if this event is available in Delphi 6 though (although I guess it is).</description>
		<content:encoded><![CDATA[<p>Hello Pierre-François,</p>
<p>In the SmartInspect Console (standard forms application), we are calling JclLastExceptStackListToStrings in the application exception event to show/log/handle unhandled exceptions. Not sure if this event is available in Delphi 6 though (although I guess it is).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre-Fr. Culand</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-57094</link>
		<dc:creator>Pierre-Fr. Culand</dc:creator>
		<pubDate>Mon, 01 Feb 2010 18:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-57094</guid>
		<description>I wonder I should be more precise concerning my need:

First be aware I&#039;m using Delphi 6 only...

I tried to use JCLDebug and JCLHookExcept units to log unhandled exceptions of my multithreaded application with a full call stack dump. (Using the JclLastExceptStackList function).

But I noticed that my exception notifier (installed with AddExceptNotifier) is called on EACH exception raised in my application, EVEN IF IT IS ALREADY HANDLED in my code.

But I just want to address unhandled exceptions that make crash one thread of my app, getting the complete call stack dump that lead to the unhandled exception raising.

How can I distinguish unhandled exceptions from handled ones ?

I didn&#039;t found how to do this...

Thanks for any help.</description>
		<content:encoded><![CDATA[<p>I wonder I should be more precise concerning my need:</p>
<p>First be aware I&#8217;m using Delphi 6 only&#8230;</p>
<p>I tried to use JCLDebug and JCLHookExcept units to log unhandled exceptions of my multithreaded application with a full call stack dump. (Using the JclLastExceptStackList function).</p>
<p>But I noticed that my exception notifier (installed with AddExceptNotifier) is called on EACH exception raised in my application, EVEN IF IT IS ALREADY HANDLED in my code.</p>
<p>But I just want to address unhandled exceptions that make crash one thread of my app, getting the complete call stack dump that lead to the unhandled exception raising.</p>
<p>How can I distinguish unhandled exceptions from handled ones ?</p>
<p>I didn&#8217;t found how to do this&#8230;</p>
<p>Thanks for any help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre-Fr. Culand</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-57090</link>
		<dc:creator>Pierre-Fr. Culand</dc:creator>
		<pubDate>Mon, 01 Feb 2010 17:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-57090</guid>
		<description>Sorry if my question is a bit trivial, I&#039;m not sur to have correctly understood that stuff.

What if I need a JCL stack trace for unhandled exceptions only ?

Thank you.
Pierre-François Culand</description>
		<content:encoded><![CDATA[<p>Sorry if my question is a bit trivial, I&#8217;m not sur to have correctly understood that stuff.</p>
<p>What if I need a JCL stack trace for unhandled exceptions only ?</p>
<p>Thank you.<br />
Pierre-François Culand</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias Gurock</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-50114</link>
		<dc:creator>Tobias Gurock</dc:creator>
		<pubDate>Fri, 23 Oct 2009 13:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-50114</guid>
		<description>Hello Roland,

Sorry for the late response. Nested exceptions should be covered as well by using the InnerException property as follows:
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;procedure p1;
begin
  try
    p2;
  except
    // Ugly, but seems to work!
    Exception.RaiseOuterException(Exception.Create(&#039;Outer exception&#039;));
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  Ex: Exception;
begin
  try
    p1;
  except
    on E: Exception do
    begin
      // Should be put in some function:
      Ex := E;
      while Assigned(Ex) do
      begin
        SiMain.LogException(Ex);
        Ex := Ex.InnerException;
      end;
    end;
  end;
end;&lt;/code&gt;&lt;/pre&gt;


I&#039;m not sure which Delphi version first introduced inner exceptions but it&#039;s available in Delphi 2009.</description>
		<content:encoded><![CDATA[<p>Hello Roland,</p>
<p>Sorry for the late response. Nested exceptions should be covered as well by using the InnerException property as follows:<br />
</p>
<pre><code>procedure p1;
begin
  try
    p2;
  except
    // Ugly, but seems to work!
    Exception.RaiseOuterException(Exception.Create('Outer exception'));
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  Ex: Exception;
begin
  try
    p1;
  except
    on E: Exception do
    begin
      // Should be put in some function:
      Ex := E;
      while Assigned(Ex) do
      begin
        SiMain.LogException(Ex);
        Ex := Ex.InnerException;
      end;
    end;
  end;
end;</code></pre>
<p>I&#8217;m not sure which Delphi version first introduced inner exceptions but it&#8217;s available in Delphi 2009.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bengtsson</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-49943</link>
		<dc:creator>Roland Bengtsson</dc:creator>
		<pubDate>Wed, 21 Oct 2009 05:50:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-49943</guid>
		<description>How does the new exception behaves for nested exceptions ?
I use D2007 now and cannot upgrade because thirdparty tools issues right now.
But if/then I upgrade it would be interresting to know if the following code will point out the original exception sourceline:

procedure p1;
begin
  try
    p2;
  except
    // Custom action, for example rollback database
    raise Exception.Create;
  end
end;

procedure p2;
begin
  // a lot of source lines
  // one of them raise an exception
end;

I use JCL with debug dcu&#039;s and logging of stacktrace to a textfile. The bad thing is that the original cause of the exception in p2 is hided. The reality can be even more complicated with several levels of try/except raise. If the new D2009 exception + JCL can solve this and point out the real cause of an exception it would alone be worth to upgrade to D2009.</description>
		<content:encoded><![CDATA[<p>How does the new exception behaves for nested exceptions ?<br />
I use D2007 now and cannot upgrade because thirdparty tools issues right now.<br />
But if/then I upgrade it would be interresting to know if the following code will point out the original exception sourceline:</p>
<p>procedure p1;<br />
begin<br />
  try<br />
    p2;<br />
  except<br />
    // Custom action, for example rollback database<br />
    raise Exception.Create;<br />
  end<br />
end;</p>
<p>procedure p2;<br />
begin<br />
  // a lot of source lines<br />
  // one of them raise an exception<br />
end;</p>
<p>I use JCL with debug dcu&#8217;s and logging of stacktrace to a textfile. The bad thing is that the original cause of the exception in p2 is hided. The reality can be even more complicated with several levels of try/except raise. If the new D2009 exception + JCL can solve this and point out the real cause of an exception it would alone be worth to upgrade to D2009.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias Gurock</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-49819</link>
		<dc:creator>Tobias Gurock</dc:creator>
		<pubDate>Sat, 17 Oct 2009 12:41:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-49819</guid>
		<description>Good point, thanks. We actually use the map file option in the SmartInspect Console.</description>
		<content:encoded><![CDATA[<p>Good point, thanks. We actually use the map file option in the SmartInspect Console.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LDS</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-49774</link>
		<dc:creator>LDS</dc:creator>
		<pubDate>Fri, 16 Oct 2009 09:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-49774</guid>
		<description>There&#039;s a caveat using debug dcus: they may have far more debugging code than you need - I mean no optimization, range checks, etc. Good for debugging, but not for release applications. JCL can use map files, compress them and add them to the executable.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a caveat using debug dcus: they may have far more debugging code than you need &#8211; I mean no optimization, range checks, etc. Good for debugging, but not for release applications. JCL can use map files, compress them and add them to the executable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias Gurock</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-49693</link>
		<dc:creator>Tobias Gurock</dc:creator>
		<pubDate>Wed, 14 Oct 2009 11:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-49693</guid>
		<description>Thanks, Patrick. Back-porting the StackTrace property sounds interesting. I&#039;m not a big fan of the specific implementation of class helpers in Delphi though (if I recall correctly, it was said to be an internal feature for the VCL and has some limitations such as one allowed class helper per class only).</description>
		<content:encoded><![CDATA[<p>Thanks, Patrick. Back-porting the StackTrace property sounds interesting. I&#8217;m not a big fan of the specific implementation of class helpers in Delphi though (if I recall correctly, it was said to be an internal feature for the VCL and has some limitations such as one allowed class helper per class only).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick van Logchem</title>
		<link>http://blog.gurock.com/postings/working-with-delphis-new-exception-stacktrace/730/comment-page-1/#comment-49667</link>
		<dc:creator>Patrick van Logchem</dc:creator>
		<pubDate>Tue, 13 Oct 2009 20:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.gurock.com/?p=730#comment-49667</guid>
		<description>Well said Tobias! Removing dependancies is a double-edged sword indeed.

As for this new StackTrace-framework, I suppose SmartInspect (or a library like the Jcl) could back-port this to older Delphi-versions too (for example via a class helper, or if not available via a Inceptor class on Exception), bringing modern features to older compilers! Just a thought...</description>
		<content:encoded><![CDATA[<p>Well said Tobias! Removing dependancies is a double-edged sword indeed.</p>
<p>As for this new StackTrace-framework, I suppose SmartInspect (or a library like the Jcl) could back-port this to older Delphi-versions too (for example via a class helper, or if not available via a Inceptor class on Exception), bringing modern features to older compilers! Just a thought&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
