Link to home
Start Free TrialLog in
Avatar of andremara
andremaraFlag for Afghanistan

asked on

Method call stack

Could I have a code snippet to obtain the method call stack, maybe in an array, for debugging purposes.
I intend to dump the stack when an error is intercepted.
So,
If Main, calls Method1, which calls Method2,
I'd like to have some kind of structure which holds:
Method2
Method1
Main
as its contents.

I'd be extra happy if I could also have some structure holding all current local variables.  Wow - that would be helpful as something to write out to an error log for inspection after failure.

Thanks!
Andre
ASKER CERTIFIED SOLUTION
Avatar of RedKelvin
RedKelvin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andremara

ASKER

Very cool about StackTrace. Works like a champ.  Thanks.
Maybe I'll put the locals question separately - you got points!