EurekaLog newsgroups
Go Back   EurekaLog newsgroups > Support > General
Reply
 
Thread Tools Display Modes
  #1  
Old 05-Mar-2012, 04:37 PM
berocoder berocoder is offline
Junior Member
 
Join Date: Sep 2008
Location: Finland in Österbotten
Posts: 7
Send a message via Skype™ to berocoder
Exclamation Can EurekaLog do this ?

I currently use JCL to log the callstack to a log-file in case of exception. It works fine. But I miss 2 things.

1. When I re raise an exception I loose the original source line of exception. For example:

procedure Buggy;
begin
// Many sourcelines and code that cause an exception
end;

procedure Caller;
begin
try
Buggy;
except
// Code that cleanup after an exception.
raise TException.Create('procedure Caller failed'); // Callstack show this line
end;
end;

In this case the callstack contains the line for raise TException, not the original sourceline in procedure Buggy. Can EurekaLog log the original sourceline in this case ?

2. When an exception happens in Delphi IDE I noticed I can see the values of arguments in the callstack. But JCL is unable to log those. Can EurekaLog do that ?

I use Delphi 2007, but plan to upgrade to Delphi XE2 when time permits and some components is ported to Unicode.

Regards
Roland Bengtsson
Team Attracs
Reply With Quote
  #2  
Old 16-Mar-2012, 09:07 AM
Alex Alex is offline
Support Team
 
Join Date: Jan 2009
Location: Russia
Posts: 1,376
Send a message via ICQ to Alex
Default

Hi,

Sorry for the delay.

1. Such feature is implemented in EurekaLog 7. See: http://www.eurekalog.com/help/eureka...tions_page.php

EurekaLog 6 doesn't have any specific support for this feature, but you may try to workaround this manually. This, however, is not pretty.

The easiest approach is to use different exception types and use exception filters to alter default processing.

For example:

procedure Caller;
begin
  try
    Buggy;
  except
    on E: Exception do
    begin
      StandardEurekaNotify(E, ExceptAddr);
      // Code that cleanup after an exception. 
      raise ECallerError.Create('procedure Caller failed'); // setup exception filter for 'ECallerError', Handler = RTL
    end;
  end;
end;
If you can't afford custom exception types - then thingg get more complicated. You need to setup your own event handlers, which alters processing based on flags (defined by you). Those flags can set in your "except" handlers.

2. Unfortunately, it is not possible in x86-32. This may be implemented in EurekaLog for x64.

Such feature requires knowledge of source files, which is available to debugger, but usually is not present in final exe. Even if you add it (for example, by including TD32/TDS info) - x86-32 has architecture, which may prevent you from getting arguments. For example, typical calling convention for Delphi is "register". This means that arguments are passed via CPU registers. Those registers can be re-used for other purposes immediately at routine's start. Debugger can track this. External software - not so much.

x86-64 is different in this matter: there is only 1 calling convention and arguments are always accessible. (I may be wrong; this requires more investigation)
__________________
Best regards...

Alexander - EurekaLog Developer Team
Reply With Quote
  #3  
Old 19-Mar-2012, 07:07 AM
berocoder berocoder is offline
Junior Member
 
Join Date: Sep 2008
Location: Finland in Österbotten
Posts: 7
Send a message via Skype™ to berocoder
Smile Can EurukaLog do this

Thanks for the information.
Actually we ship full debug info to released exe-file. And we have plans to update from Delphi 2007 to latest Delphi XE2 and x64. So to get arguments to methods would be a very nice feature in future versions of EurekaLog.
Even if it only apply for x64 exe.

Regards
Roland Bengtsson

Quote:
Originally Posted by Alex View Post
Hi,

Sorry for the delay.

1. Such feature is implemented in EurekaLog 7. See: http://www.eurekalog.com/help/eureka...tions_page.php

EurekaLog 6 doesn't have any specific support for this feature, but you may try to workaround this manually. This, however, is not pretty.

The easiest approach is to use different exception types and use exception filters to alter default processing.

For example:

procedure Caller;
begin
  try
    Buggy;
  except
    on E: Exception do
    begin
      StandardEurekaNotify(E, ExceptAddr);
      // Code that cleanup after an exception. 
      raise ECallerError.Create('procedure Caller failed'); // setup exception filter for 'ECallerError', Handler = RTL
    end;
  end;
end;
If you can't afford custom exception types - then thingg get more complicated. You need to setup your own event handlers, which alters processing based on flags (defined by you). Those flags can set in your "except" handlers.

2. Unfortunately, it is not possible in x86-32. This may be implemented in EurekaLog for x64.

Such feature requires knowledge of source files, which is available to debugger, but usually is not present in final exe. Even if you add it (for example, by including TD32/TDS info) - x86-32 has architecture, which may prevent you from getting arguments. For example, typical calling convention for Delphi is "register". This means that arguments are passed via CPU registers. Those registers can be re-used for other purposes immediately at routine's start. Debugger can track this. External software - not so much.

x86-64 is different in this matter: there is only 1 calling convention and arguments are always accessible. (I may be wrong; this requires more investigation)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 05:32 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © EurekaLab s.a.s. - VAT ID: IT05554520824