Page 1 of 1

ImportBugReport doesn't import CallStacks?

Posted: Sun May 20, 2018 11:07 am
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.

Re: ImportBugReport doesn't import CallStacks?

Posted: Tue May 22, 2018 5:31 pm
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.

Re: ImportBugReport doesn't import CallStacks?

Posted: Wed May 23, 2018 8:17 am
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

Re: ImportBugReport doesn't import CallStacks?

Posted: Wed May 23, 2018 8:34 am
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.

Re: ImportBugReport doesn't import CallStacks?

Posted: Wed May 23, 2018 10:00 am
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.

Re: ImportBugReport doesn't import CallStacks?

Posted: Wed May 23, 2018 10:54 am
by madshi
Yes.

No.