ImportBugReport doesn't import CallStacks?

delphi package - automated exception handling

ImportBugReport doesn't import CallStacks?

Postby edwinyzh » Sun May 20, 2018 11:07 am

Dear Mathias,

The background
===
I'm implementing a custom madExcept exception viewer for exception messages collected from users.

I use the IMEException interface instance returned by ImportBugReport(), and I have successfully displayed the general exception summary (such as Exception Message, User's OS, etc) through IMEException.BugReportHeader.

The issue
===
And I'm having an issue for the second step - to show the call stacks. I first tried to read IMEException.CallStacks, but it's empty.
I debugged into madExcept.pas, and it seems that TIMEException.GetBugReportSections.PrepareThreadReport() where the call stacks are pared is not called, not sure why.
Am I going the wrong direction? Thanks.

Also, How do I get the thread name (something like "main thread ($1fe0)" of IMEException.CallStacks[i]?

Thank you very much in advance.

---------------------
ps: madException version: The latest madCollection-2.8.4.0 with MadException 4.0.19
ps2: I confirm IMEException.BugReportSections does seem to contain the correct string content.
edwinyzh
 
Posts: 35
Joined: Sat Jun 29, 2013 8:23 am

Re: ImportBugReport doesn't import CallStacks?

Postby madshi » Tue May 22, 2018 5:31 pm

Some parts of IMEException are only filled for "live" exceptions, but not when reading from a file or stream/string. It's been a while since I looked into this, but it's very possible that "Callstacks" only works for "live" exceptions. My own viewer tool seems to use BugReportSections to access the callstacks. See the fairly complicated "PrepareListView_Thread" function in madExcept to see how the string is split into separate paths for viewing the callstacks properly.
madshi
Site Admin
 
Posts: 9757
Joined: Sun Mar 21, 2004 5:25 pm

Re: ImportBugReport doesn't import CallStacks?

Postby edwinyzh » Wed May 23, 2018 8:17 am

@madshi,

Thanks, and I want to parse the call stack strings by myself. I have some observations illustrated in the screenshot, please point out errors if you find any:

Image
edwinyzh
 
Posts: 35
Joined: Sat Jun 29, 2013 8:23 am

Re: ImportBugReport doesn't import CallStacks?

Postby madshi » Wed May 23, 2018 8:34 am

Yes, that seems correct. Just to be safe: There could just be a module name and no function name. Or there could be both. There could be a global line number and a relative line number, or just a global line number or none at all.
madshi
Site Admin
 
Posts: 9757
Joined: Sun Mar 21, 2004 5:25 pm

Re: ImportBugReport doesn't import CallStacks?

Postby edwinyzh » Wed May 23, 2018 10:00 am

Thanks madshi for the details.

By "global line number", do you mean "absolute line number", which is column 5 in the first line showing in the above screenshot?

BTW, does HyperJumpCallstack() works even the madExcept package is not installed in the Delphi IDE?

Thanks.
edwinyzh
 
Posts: 35
Joined: Sat Jun 29, 2013 8:23 am

Re: ImportBugReport doesn't import CallStacks?

Postby madshi » Wed May 23, 2018 10:54 am

Yes.

No.
madshi
Site Admin
 
Posts: 9757
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 5 guests