4

In trying to find the possible cause of an exception, I'm following a code path using Reflector. I've got deeper and deeper, but ended up at a method call that looks like:

[MethodImpl(MethodImplOptions.InternalCall)]
private extern void SomeMethod(int someParameter);

This markup on the method tells the framework to call a C++ function somewhere. Is there any way to find out what method actually gets called, and in turn what else is likely to be called?

NB: I don't really want to see the source code of this method, I just want to know the possible things that could throw the exception I am seeing that originates out of this method call.

4

2 回答 2

3

内部调用最终会调用 CLR 中的 C++ 函数。您可以在转子源代码中找到它们。查看 clr\src\vm\ecall.cpp 以找到从 .NET 可见名称到 CLR 函数名称的映射。请注意,来源已过时。

于 2010-05-05T18:46:03.990 回答
0

如果您想追踪哪些方法可以抛出给定类型的异常,您可以使用http://www.red-gate.com/products/Exception_Hunter/index.htm

于 2010-05-27T14:54:10.547 回答