ImportBugReport doesn't import CallStacks?

delphi package - automated exception handling
Post Reply
edwinyzh
Posts: 40
Joined: Sat Jun 29, 2013 8:23 am

ImportBugReport doesn't import CallStacks?

Post by edwinyzh »

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?

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.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: ImportBugReport doesn't import CallStacks?

Post by madshi »

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.
edwinyzh
Posts: 40
Joined: Sat Jun 29, 2013 8:23 am

Re: ImportBugReport doesn't import CallStacks?

Post by edwinyzh »

@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
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: ImportBugReport doesn't import CallStacks?

Post by madshi »

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.
edwinyzh
Posts: 40
Joined: Sat Jun 29, 2013 8:23 am

Re: ImportBugReport doesn't import CallStacks?

Post by edwinyzh »

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.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: ImportBugReport doesn't import CallStacks?

Post by madshi »

Yes.

No.
Post Reply