[Mono-dev] Unhandled exception behavior

Paolo Molaro lupus at ximian.com
Fri Sep 7 13:35:15 EDT 2007


On 08/31/07 Massimiliano Mantione wrote:
> Index: mono/metadata/object.h
> ===================================================================
> --- mono/metadata/object.h	(revision 84274)
> +++ mono/metadata/object.h	(working copy)
> @@ -242,6 +242,11 @@
>  mono_runtime_exec_main	    (MonoMethod *method, MonoArray *args,
>  			     MonoObject **exc);
>  
> +void
> +mono_runtime_force_legacy_unhandled_exception_policy (void);
> +gboolean
> +mono_runtime_uses_legacy_unhandled_exception_policy (void);

This should go into object-internals.h and marked MONO_INTERNAL.
It would likely be better to have something like:

enum {
	MONO_UNHANLED_POLICY_LEGACY,
	// need a better name
	MONO_UNHANLED_POLICY_SOME_DESCRIPTIVE_WORD_OF_THE_NEW_BEHAVIOUR
};

and then:

void mono_runtime_unhandled_policy_set (int policy);
int  mono_runtime_unhandled_policy_get (void);

> Index: mono/metadata/mono-config.c
> ===================================================================
> --- mono/metadata/mono-config.c	(revision 84274)
> +++ mono/metadata/mono-config.c	(working copy)
> @@ -289,6 +289,33 @@
>  	dllmap_finish
>  };
>  
> +static void
> +legacyUEP_start (gpointer user_data, 
> +              const gchar         *element_name,
> +              const gchar        **attribute_names,
> +              const gchar        **attribute_values) {
> +	if ((strcmp (element_name, "legacyUnhandledExceptionPolicy") == 0) &&
> +			(attribute_names [0] != NULL) &&
> +			(strcmp (attribute_names [0], "enabled") == 0)) {
> +		if ((strcmp (attribute_values [0], "1") == 0) ||
> +				(strcmp (attribute_values [0], "true") == 0) ||
> +				(strcmp (attribute_values [0], "True") == 0) ||
> +				(strcmp (attribute_values [0], "TRUE") == 0)) {

Why not use a case insensitive compare here?

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list