Cannot capture the Error line correctly.

delphi package - automated exception handling
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Cannot capture the Error line correctly.

Post by luciano_f »

Hey how is everything.
How should I configure MadExcept correctly to capture the correct line of Error.

because he is not able to capture the line where the problem was triggered.

I put two buttons on the Form for you to understand better.
It took me a while to find the problem.

What should I configure so that when I click on the "Button1" button he can capture it correctly because the error is the same as "button2"
Attachments
Not Capture madexcept.7z
(19.82 KiB) Downloaded 11 times
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

I'm not sure I'm seeing the same thing that you're seeing. I can't compile the project without modifying it. E.g. the dpr references "LfResizerVcl", which isn't available, and the "ResizerVcl" unit has a "{$R LfResizerVcl.dcr}" instruction which trips up the compiler because the dcr file is not available. If I remove those two, I can compile. And after that, for me the callstacks for both buttons looks ok. Though, it's a rather complex callstack. Also, I don't know which Delphi version you tested with.
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

hello I'm sorry I had left traces of another component

now i cleaned.

Attached is a new example where clicking on button1 is not able to correctly capture the line of code where the error originated
Attachments
Not Capture madexcept.7z
(9.36 KiB) Downloaded 13 times
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

Which Delphi version?
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

If I click on Button2 then MadExcept can capture the entire stack that originated the Bug.

Attached is a Video where I did a test with EurekaLog Log
https://mega.nz/file/o7QH2QpL#th3LxEWQR ... wInqcZvte8

and it manages to catch the error.

Delphi XE 10.4 Update 2
Application the 32 Bits
Windows 10 64 Bits.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

You can workaround the issue by activating "delphi compiler -> compiling -> stack frames" in the project options. Does that help?
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

It is active and does not resolve
I also tested disabling

Image
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

You need to rebuild the project. It worked for me after rebuilding it, but not before.
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

That thing here doesn't work at all
attached my "dproj"

and a video of how I did it.
https://mega.nz/file/57pSRSrK#2uY78cMQi ... DepkYZ5RwE

Note
Delphi XE 10.4 Update 2
Application the 32 Bits
Windows 10 64 Bits.
Attachments
Project1.7z
(2.13 KiB) Downloaded 11 times
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

I've just double checked: I was mistaken, it was not the stack frames which solved this, it was switching from debug build to release build. I did both changes at the same time, and thought it must have been the stack frames. I've tested this with XE8, though. But I assume it's probably the same with XE10.4?
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

I've just double checked: I was mistaken, it was not the stack frames which solved this, it was switching from debug build to release build. I did both changes at the same time, and thought it must have been the stack frames. I've tested this with XE8, though. But I assume it's probably the same with XE10.4?
If I understand correctly you enabled "stack frames" in Release and Debug
but here it doesn't work.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

You don't get a proper callstack in release mode builds? Here, I get an incomplete callstack with debug builds (not sure why), but I get a complete callstack with release builds.
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

New Video explaining better and showing that EurekaLog can capture the entire Error Stack.
https://mega.nz/file/EuBxSCbD#qopcW4RUw ... 6gf5Mb9vlk

The worst thing is that there are several other errors in my project that are happening even though it can't capture the entire Error Stack, but the other errors are more complicated to create a test project to send you.

I believe it would be good for Colleague to get Delphi 10.4 XE Update 2 to do some tests

note : I tested it on another machine with Delphi 10.2
and it was also not possible to capture the entire error Stack.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Cannot capture the Error line correctly.

Post by madshi »

Ok, here are the steps I took:

1) I downloaded your test project.
2) I compiled it in debug mode.
3) I was able to reproduce the problem.
4) I switched to release mode and recompiled.
5) I was still able to reproduce the problem.
6) I right clicked the project and selected "rebuild".
7) Now it works properly.
8) I switched back to debug mode and recompiled.
9) Now this works, as well.
a) Now I rebuilt in debug mode.
b) Now it doesn't work, any longer.

Tested with Delphi 10.4 on Windows 10.

This seems all rather weird to me. But I can reproduce this every time.
luciano_f
Posts: 47
Joined: Thu Feb 01, 2018 5:11 pm

Re: Cannot capture the Error line correctly.

Post by luciano_f »

Got it and now I've also managed to get it to catch the entire error stack.

But I see that it is very complicated to do this so that you can catch the error.

Are you going to implement some programming in MadExcept to be able to solve this ?
See with EurekaLog you don't need all that to be able to capture from the 1st Build.
Post Reply