CreateBugReport problem?

delphi package - automated exception handling
Post Reply
jsantos98
Posts: 13
Joined: Fri Jun 03, 2005 1:21 am

CreateBugReport problem?

Post by jsantos98 »

Hello Madshi,

I'm trying to simply generate the report text, but I'm facing some problems:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var strBugReport : String;
begin
   try
      raise (Exception.Create('Test'));
   except on e : Exception do
      begin
        strBugReport :=  madExcept.CreateBugReport(false, e, ExceptAddr, GetCurrentThread(), Esp, Ebp, false);
        ShowMessage (strBugReport);

        HandleException();
      end;
   end;
end;
This generates a report like this :

Code: Select all

...
thread $fffffffe:
>> stack not accessible, exception location: 
0042b632 MainDemo.exe uMainDemoForm 301 TForm1.Button7Click'

main thread ($f64):
7c90eb94 ntdll.dll   KiFastSystemCallRet
7c90d9bf ntdll.dll   NtFindAtom
7c90eae0 ntdll.dll   KiUserCallbackDispatcher
77d4b8fe USER32.dll  SendMessageW
77d4e900 USER32.dll  CallWindowProcA
77d496c2 USER32.dll  DispatchMessageA'
However, the message shows something a little different :

Code: Select all

main thread ($578):
0042b62d MainDemo.exe uMainDemoForm 301 TForm1.Button7Click
7c90f0a5 ntdll.dll                      RtlAnsiStringToUnicodeString
7c90eae0 ntdll.dll                      KiUserCallbackDispatcher
77d4b8fe USER32.dll                     SendMessageW
77d4e900 USER32.dll                     CallWindowProcA
77d496c2 USER32.dll                     DispatchMessageA
0042baff MainDemo.exe MainDemo       52 initialization
How can I make the reports match? What am I doing wrong?


Best regards,

Joao Santos
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You need to use GetCurrentThreadId instead of GetCurrentThread.
jsantos98
Posts: 13
Joined: Fri Jun 03, 2005 1:21 am

Post by jsantos98 »

Ops... :oops:


Thanks for your help. :blush:

Joao
Post Reply