Discussion:
Variable is optimised and is not available
(too old to reply)
v***@tut.by
2008-07-28 08:43:59 UTC
Permalink
Hi,
sorry if it was upcoming more than twice...

Debugging in depth of vcl source I still see some variables (mostly
parameters)
are reported as "optimized annot available" in "locals" window.
Still that was a "debug" configuration with debug libs.

How to to see the variables? Any hints?

Thank you!
JohnC
2008-07-28 13:52:08 UTC
Permalink
Have you turned off all optimizations?
Post by v***@tut.by
Hi,
Debugging in depth of vcl source I still see some variables (mostly
parameters)
are reported as "optimized annot available" in "locals" window.
Still that was a "debug" configuration with debug libs.
How to to see the variables? Any hints?
Thank you!
VLK
2008-07-29 12:14:44 UTC
Permalink
Post by JohnC
Have you turned off all optimizations?
yes, surely. debug build.
I see that functions params are in registers - still they are in builder's
debug build libs...
looks strange..
Ed Mulroy [TeamB]
2008-07-29 13:47:48 UTC
Permalink
People view some code generation items as optimization when they are viewed
by the compiler writers as normal. Putting variables in registers is one of
those items.

Most VCL source uses the __fastcall convention. That convention demands
that calling arguments be passed in registers, or at least as many of them
as will fit in the registers. Enabling debug will not change that. Break
on entry to the function and select CPU view to see what the variable values
in registers are.

. Ed
Post by v***@tut.by
sorry if it was upcoming more than twice...
Debugging in depth of vcl source I still see some variables (mostly
parameters)
are reported as "optimized annot available" in "locals" window.
Still that was a "debug" configuration with debug libs.
How to to see the variables? Any hints?
VLK
2008-07-29 14:25:10 UTC
Permalink
__fastcall is great.. but bcb4-5-6 was easily showing the parameters
of any __fastcall function of vcl source during debug.

Now if I have my own __fastcall function in debug its header contains:
mov [ebp-n1], eax
mov [ebp-n2], edx

to make it possible see locals in debug.. it's nice solution..
but vcl isn't made so.. can I recompile libs myself with some options
that will do the same?

It looks really disappointing to take values from registers and
type them in memory dump and then to look in structures adding offsets.
It kills time. :( I hope for magic option to switch and everything works
like it workED before. is there any?
Post by Ed Mulroy [TeamB]
Most VCL source uses the __fastcall convention. That convention demands
that calling arguments be passed in registers, or at least as many of them
as will fit in the registers. Enabling debug will not change that.
Break
on entry to the function and select CPU view to see what the variable values
in registers are.
. Ed
Post by v***@tut.by
sorry if it was upcoming more than twice...
Debugging in depth of vcl source I still see some variables (mostly
parameters)
are reported as "optimized annot available" in "locals" window.
Still that was a "debug" configuration with debug libs.
How to to see the variables? Any hints?
Ed Mulroy [TeamB]
2008-07-29 19:39:49 UTC
Permalink
When you step into the provided VCL binaries there is no magic setting
to make it do what you decided to do. I have trying for years to get the
debugger designers to provide a "do what I mean" option but they
never provide it :-)

For structures you might try using the evaluate window and type in a cast
from a pointer of the value in the register or you might try using the
register name itself as in
*((NameOfTheType *)_EBX).

. Ed
Post by VLK
__fastcall is great.. but bcb4-5-6 was easily showing the parameters
of any __fastcall function of vcl source during debug.
mov [ebp-n1], eax
mov [ebp-n2], edx
to make it possible see locals in debug.. it's nice solution..
but vcl isn't made so.. can I recompile libs myself with some options
that will do the same?
It looks really disappointing to take values from registers and
type them in memory dump and then to look in structures adding offsets.
It kills time. :( I hope for magic option to switch and everything works
like it workED before. is there any?
VLK
2008-07-30 19:25:13 UTC
Permalink
Post by Ed Mulroy [TeamB]
*((NameOfTheType *)_EBX).
thank you very much indeed...

still.. the only question's left - why did it stop working?
it was nice in earlier versions..

is it possible to recompile vcl source with these substitutions
for fn params and results?
(that after __fastcall a compiler makes
mov [ebp-n], eax
for every param)

Loading...