Re: debugging release version build issue in managed code by Ondrej
Ondrej
Thu Oct 16 03:39:32 CDT 2008
Please, learn something about how manager works first. Basics are:
With managed code there are two compilations: compile time (into
intermediate representation, which is the same for all platforms) and
runtime (this intermediate representation is JIT compiled into native code).
> assembly code rules to optimize) -- so it is why I met with the
similar issue
> that debugger can not display variable values when variable is in
register.
The intermediate code is a virtual machine code, therefore you can
handle it with the same approach as you do for the native code, and this
is also what compiler does - it uses the same optimization techniques
(variables in registers). See my recent answer in your original "native
release debugging" topic to see why you see the issue and what
techniques you can learn to be able to watch variables in the release build.
Cheers
Ondrej
George napsal(a):
> Thanks cd,
>
>
> Actually I build it with Any CPU when build the managed code, and I run it
> on x64 machine. I noticed fast call calling convention is used -- it is from
> the assembly code which the 1st 4 parameters are in register. So I suspect,
> for managed code even if I build it with Any CPU release mode, but if I run
> it on x64 machine, it becomes a x64 native code release mode, and follows x64
> release mode assembly code rules to optimize (when I run it on x86 machine,
> it becomes a x86 native code release mode, and follows x86 release mode
> assembly code rules to optimize) -- so it is why I met with the similar issue
> that debugger can not display variable values when variable is in register.
> So, even if managed code from IL level are the same, the resulting native
> assembly code is different on x64/x86. And it is also called JIT platform
> dependent optimization?
>
> Do you think my analysis is correct? :-)
>
>
> regards,
> George