PDA

View Full Version : Is it possible to obtain all debug information and log it manually?


Konstantin Knyazev
16-Jun-2005, 10:44 AM
Is subject possible? I want this:

try
Some code..
except
GetExceptInfo
SaveExceptInfo;
end;

Thnak you!

admin
17-Jun-2005, 09:39 AM
Yes, you chould use an ExceptionNotify event like this:


uses ExceptionLog, ECore, ETypes; // The required units...

// This is a normal procedure (not a method)...
procedure MyNotify(ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
ExcRecord.LogText ... // Is the full log.
end;

Konstantin Knyazev
17-Jun-2005, 12:34 PM
I found next workaround:

var
ErrorInfo: String;

procedure MyNotify( ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
ErrorInfo := ExcRecord.LogText ... // Is the full log.
Handled := False;
end;

try
...
except
on E: Exception do
begin
StandardEurekaNotify( E , ExceptAddr);
SaveErrorInfo(ErrorInfo);
end;
end

Is it correct?

But it is some inconveniently. It would be much easier for me if you add some GetDebugInfo function that return needed info :) Now, i use JCL, but your error information is much better, but i don't want change logic in big project. Thank you anyway!

Konstantin Knyazev
17-Jun-2005, 01:41 PM
There are som doubles in the stack list:

|004A397A|GUI.exe |MainForm.pas| |AccessViolation |147[1] |
|004A3978|GUI.exe |MainForm.pas| |AccessViolation |147[1] |
|004A3BF3|GUI.exe |MainForm.pas| |RunError |235[2] |
|004A3BC0|GUI.exe |MainForm.pas| |RunError |233[0] |
|004A3C37|GUI.exe |MainForm.pas| |Error |249[1] |
|004A3C34|GUI.exe |MainForm.pas| |Error |248[0] |
|004A3C43|GUI.exe |MainForm.pas| |RaiseException |254[1] |
|004A3C40|GUI.exe |MainForm.pas| |RaiseException |253[0] |

What does it mean?

admin
20-Jun-2005, 09:35 AM
There aren't any doubles because the address are different! ;)

Konstantin Knyazev
20-Jun-2005, 09:58 AM
This is a stack list and there are no recursion. So, why there are two lines from the one procedure? And will my workaround work properly and is there standard method for this?
Thank you!

Konstantin Knyazev
23-Jun-2005, 10:26 AM
Why there are some doubled records per one routine?

|004A397A|GUI.exe |MainForm.pas| |AccessViolation |147[1] |
|004A3978|GUI.exe |MainForm.pas| |AccessViolation |147[1] |

And in other routins only single record?