私が欲しいものを正しく説明する方法がわかりません。これが例です^
public void foo()
{
StackFrame trace = new StackFrame(1);
MethodBase method = trace.GetMethod(); //so, here we'll get bar-method info
MthodBody body = method.GetMethodBody(); //and here we'll get bar-method body
/*now i need get access to the local vars in bar
i know about MethodBody.LocalVariables
but i don't have any idea how i can get values of variables i and hello,
that defined in bar-method. I think it may be possible if i'll get
pointers to the vars,
and then copy it with Marshal.Copy*/
}
public void bar()
{
int i = 42;
string hello = "Hello!";
foo();
}
PS私の例がひどいものではなかったことを願っています。 PPS悪い悪い英語ですみません:)