[Mono-dev] [PATCH] MONO_IOMAP reporting option

Marek Habersack grendel at twistedcode.net
Thu Nov 19 18:32:33 EST 2009


Robert Jordan wrote:
> Hi Marek,
Hey Robert,

[snip]
>> 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.
Good catch, missed that one - thanks :)

marek
> 
>> +
>> +	fprintf (stdout, "-= Stack Trace =-\n%s\n\n", stack_trace);
>> +	fflush (stdout);
>> +}
> 
> Robert
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 



More information about the Mono-devel-list mailing list