[Mono-dev] embedded runtime questions
robertj at gmx.net
Sat Sep 10 05:35:27 EDT 2005
> 2. Is there a facility to get a MonoMethod* that is more specific than
> mono_class_get_method_from_name? This works fine until you have
> multiple methods with the same name and the same number of arguments.
You have at least 2 choices:
mono_class_get_methods (MonoClass*, gointer* iter);
and build your own signature lookup.
Use the functions from debug-helpers.h
mono_method_desc_new (const char *name, gboolean include_namespace);
The format of the name is partially documented
in mono/metadata/debug-helpers.c. It's not documented that
the name may omit the classname, e.g. ":method(int,int)"
but there are a lot of use cases in Mono's source for that.
After you got the MethodDesc you can lookup the method
mono_method_desc_search_in_class (MonoMethodDesc *desc,
And don't forget to free the desc with
mono_method_desc_free (MonoMethodDesc *desc);
More information about the Mono-devel-list