Save/Restore stack state - is it possible?  
Author Message
Andrei Faber





PostPosted: Common Language Runtime, Save/Restore stack state - is it possible? Top

I know about stack substitution/saving/restoring techniques, which can be used under native win32 apps. Is this possible, when running under .NET Are there any resources, explaining internals of CLR

.NET Development37  
 
 
nobugz





PostPosted: Common Language Runtime, Save/Restore stack state - is it possible? Top

AFAIK, the JIT compiler generates code that uses standard stack frames, indexed by the EBP and ESP registers. Injecting the asm code required to mess with this is an entirely different matter. As is avoiding problems with exception handling. Why would you want to do something like this



 
 
Andrei Faber





PostPosted: Common Language Runtime, Save/Restore stack state - is it possible? Top

I think about a tool, which would allow to "save" state of the executing program, and to fall back to that point later. I think this would be useful for debugging :)
 
 
nobugz





PostPosted: Common Language Runtime, Save/Restore stack state - is it possible? Top

You'll need to prevent the app from continuing running, just suspend all its threads. If you're thinking about implementing your own de****, you ought to take a look at the MDbg sample. There's a forum dedicated to MDbg here too.