tags:

views:

30

answers:

2

Some IDEs (like Eclipse) seem to allow method calls to be inspected while debugging. How is this done without causing side effects?

+2  A: 

I know that in Visual Studio, executing code as part of 'inspecting' some value can indeed have effects. I think all debuggers are probably like this. Beware!

Brian
yes, that's the point of calling the function... the sideeffects!
MK
I found a blog post claiming [Func-eval is evil](http://blogs.msdn.com/jmstall/archive/2005/03/23/400794.aspx) with a [whole category](http://blogs.msdn.com/jmstall/archive/category/11475.aspx) about this
Casebash
A: 

I believe Brian is right. However, you could do it by saving the registers and tracking any memory writes, and restoring them when the inspection ends

Michael Mrozek