Page 1 of 2

Cannot capture the Error line correctly.

Posted: Sat Feb 05, 2022 11:22 am
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"

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 2:03 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 3:19 pm
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

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 3:28 pm
by madshi
Which Delphi version?

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 3:31 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 4:07 pm
by madshi
You can workaround the issue by activating "delphi compiler -> compiling -> stack frames" in the project options. Does that help?

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 4:42 pm
by luciano_f
It is active and does not resolve
I also tested disabling

Image

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 4:50 pm
by madshi
You need to rebuild the project. It worked for me after rebuilding it, but not before.

Re: Cannot capture the Error line correctly.

Posted: Mon Feb 07, 2022 5:07 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Wed Feb 09, 2022 5:04 pm
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?

Re: Cannot capture the Error line correctly.

Posted: Wed Feb 09, 2022 8:14 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Wed Feb 09, 2022 8:19 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Wed Feb 09, 2022 8:51 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Thu Feb 10, 2022 12:03 pm
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.

Re: Cannot capture the Error line correctly.

Posted: Thu Feb 10, 2022 1:28 pm
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.