Information générale
Catégorie:
Code, syntaxe and commandes
>>>Only in C++ can you set a breakpoint to fire *when* a variable changes so that you
>>>can, for example, examine the stack to see what caused it.
There are machine-level (CPU itself) debug facilities which allow you to break when a particular memory address is read or written to. If you can obtain the literal machine address of managed variable, then you would be able to attach a debugger to the running instance of a .NET VM, and then break the VM itself whenever that memory address changes (using debugger facilities), or is read or written to if you use the kernel debugger.
The debugger doesn't have to be the Visual Studio Debugger. Any debugger will do, including your own custom app which creates an HWND for your managed app to send messages to about its physical hardware address, for example.
Lots of options. Just depends on how big of a deal it is.
>>Didn't know that was a limitation of .net.
>>Okay... Hmmm... How about creating a class with operator overrides, replacing the
>>instance variable with the class, and breaking there?
>Possible. You could achieve the same by using a property and breaking on the
>setter - but either implies having to change production code for testing......
Am very surprised .NET doesn't offer that. Seems a standard developer tool (hence it being included directly in silicon within the i386 and later definitions).
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement