Debugging: local variables "do not exist in current context"

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, Alex.Davies, melvyn.harbour

Debugging: local variables "do not exist in current context"

Postby fvicente » Wed Oct 27, 2010 12:05 pm

Hello,

we're having some trouble debugging a SA-merged assembly in VS2008. We've used both our licensed SA5.5 and the SA6 beta and the result is the same:

We generate debugging info in SA, and debugging works fine for breakpoints, step-into and all but for methods local variables. We can see the values of every method parameter or class attributes, but not the values of local variables - it's as if they don't exist. We tried with mouse hover, immediate window and watches to no avail. Also, conditional breakpoints which mention local variables don't work due to "The name 'xxxx' does not exist in the current context". However, code lines that use them execute normally.

If we reference the original assembly this behaviour disappears so this information is clearly lost in the merging process.

We thought at first it could be related to the code being optimized but we don't check any option regarding optimization, obfuscation or whatever - we just do the merge and generate the pdb - also we sign with a strongname but that shouldn't be related...

Any ideas of what could be causing this? Has anyone experienced this before?

Thanks!

EDIT: I tried an unsigned version just in case, same result
fvicente
 
Posts: 2
Joined: Wed Oct 27, 2010 11:53 am
Location: Madrid, Spain

Postby Alex.Davies » Wed Oct 27, 2010 6:02 pm

Yep, the pdb generated by SmartAssembly isn't as good as the original, and that is one of the things that it usually gets wrong.

I tend to use .NET Reflector pro to debug obfuscated assemblies, personally, although obviously that means you have to reduce the obfuscation level to the minimum you can to reproduce the problem. Luckily problems with control flow obfuscation are really rare, because you can't use Reflector pro with that turned on.
Alex
Developer,
Red Gate .NET Tools
Alex.Davies
 
Posts: 335
Joined: Tue Dec 02, 2008 12:23 pm
Location: Cambridge, uk

Re:

Postby fvicente » Thu Oct 28, 2010 8:09 am

Alex.Davies wrote:Yep, the pdb generated by SmartAssembly isn't as good as the original, and that is one of the things that it usually gets wrong.


Any chance this is getting this fixed in SA 6? I understand the local variable info is inside the original pdbs so SA should be 'merging' this info too right?

It's quite critical to our development process to be able to debug our merged-SDKs properly.

Thanks for the response, Alex
fvicente
 
Posts: 2
Joined: Wed Oct 27, 2010 11:53 am
Location: Madrid, Spain


Return to SmartAssembly 5

Who is online

Users browsing this forum: No registered users and 0 guests