[Mono-dev] [PATCH] MONO_IOMAP reporting option

Robert Jordan robertj at gmx.net
Thu Nov 19 18:07:47 EST 2009


Hi Marek,

Marek Habersack wrote:
> Hey folks,
> 
>     The attached patch implements a new option for the MONO_IOMAP 
> mechanism - "report". The option tells the mapping code to print 
> information to stdout each time a mismatch is found. The information 
> includes requested file name, actual file name and a managed stack 
> trace. The patch makes it easier to port applications which are full of 
> code accessing files with incorrect case in names. Is it ok to commit 
> the diff?

> +static inline void print_report (const gchar *report)
> +{
> +	MonoClass *klass;
> +	MonoProperty *prop;
> +	MonoString *str;
> +	char *stack_trace;
> +
> +	fprintf (stdout, "-=-=-=-=-=-=- MONO_IOMAP REPORT -=-=-=-=-=-=-\n%s\n", report);
> +	klass = mono_class_from_name (mono_defaults.corlib, "System", "Environment");
> +	mono_class_init (klass);
> +	prop = mono_class_get_property_from_name (klass, "StackTrace");
> +	str = (MonoString*)mono_property_get_value (prop, NULL, NULL, NULL);
> +	stack_trace = mono_string_to_utf8 (str);

stack_trace must be g_free()d.

> +
> +	fprintf (stdout, "-= Stack Trace =-\n%s\n\n", stack_trace);
> +	fflush (stdout);
> +}

Robert



More information about the Mono-devel-list mailing list