ScanIAm wrote:
 | RichardRudek wrote:I am not an expert. But it seems to me that your having some kind of mental block on this. That is, you appear to confusing your "cake recipe" with an actual cake.
|
The cake is a lie.
No, at the moment, your looking at the cake over a webcam - you need to travel over to where the actual cake is...

ScanIAm wrote:
 | RichardRudek wrote: As has already been mentioned, by the time your within an exception block, about the only thing left for you to do is to try and scrounge up whats left by trolling though the stack. ie the Debugging APIs.
|
This wouldn't be in an exception condition, but yep, someone did mention using the Debugging APIs. I just haven't had a chance to look at them yet.
Run, don't walk...

ScanIAm wrote:
 | RichardRudek wrote: About the only other way that I can think of is if you force all of your routines to use globals variables rather than parameters. As has already been mentioned, these parameters live on the stack, not on the heap (globals). And debuggers use the debugging APIs.
|
But, .NET operates differently than an unmanaged app. There aren't any INT13 calls to be made, because the CLR is processing and interpreting the IL. It can stop any time it wants to whereas an unmanaged app needs to force the CPU to be interrupted.
Ah, and therein lies your mental block.
Here's a question, what does JIT'ing do ?
BTW, just to be pedantic, it's INT 3. INT 13, depending upon whether your decimal or hex is either a General protection fault/exception, or BIOS disk I/O...

ScanIAm wrote:
 | RichardRudek wrote: As for the ASP bind/eval stuf, I doubt your perception. Remember, your looking for the actual passed in parameters - the cake.
|
Yes, exactly. For example, if I'm displaying a gridview, and using an ObjectDataSource, the only thing I need to tell the GridView is the 'name' of the return object. It is able to take that 'name' and the Type and end up with the value found inside that variable.
In this case, I have the name and type of the parameters, but no way to get .NET to evaluate the parameter (like the GridView does).
Yes, you have the cake receipe. The
actual data is on the stack (in the current stack-frame). The original source of that data, before it was parametised, may also be on the stack (in an earlier stack-frame), or it may be on the heap.
You know those stack traces you see when your debugging ?
Well guess what, to produce those, and the local variables stuff, requires some rather "heavy magic" (good some Sam). And where is this magic ?
Well it's likely to be in the debugging API's. I have don't know for certain because I've not had the need to go look. Whereas you appear
to, so go ahead...
Is this "magic" perfect ?
No. I don't know for about Managed code, but I often see the Stack traces which have warnings to the effect that, what you see beyond this point in the stack trace is my
best guess, so caution.
ScanIAm wrote:
There has to be some behind-the-scenes magic going on to allow the Bind or Eval functions to obtain the values of an object based solely on the name and type of the object, so why can't I do this?
Yes, there will be "instance tables", metadata which is probably incorporated with the Garbage Collector. But I suspect that they would have optimised what is tracked. ie data on the stack is a completely different proposition than data in what I call the heap. I'm not sure such terminology is correct for Managed code, but I don't see point if it's not.
You have to remember that when you pass stuff via parameters, space is made for it (or a reference to it) on the stack. From a debugging point of view, the data is in a different stack-frame. Each time you enter a new routine, and I believe that also includes the processing of an exception, a new stack-frame is setup. To decode this resulting stack (which contains multiple stack-frames) is a tricky business. There'll be return addresses, saved registers, and locals such as parameters and local variables in
each stack frame. That's the magic.