X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftrace.c;h=b81fe604ed3aef345b7eef2ca52c01e4630172d7;hb=770ea9329202d7dad0f6abb92dcadd84a899b0d5;hp=95c860902337d51aa113de03ce00649e255d807b;hpb=72799c7657dcce2d9e4f6c20314c77768cfcf96d;p=mono.git diff --git a/mono/mini/trace.c b/mono/mini/trace.c index 95c86090233..b81fe604ed3 100644 --- a/mono/mini/trace.c +++ b/mono/mini/trace.c @@ -1,5 +1,6 @@ -/* - * trace.c: Tracing facilities for the Mono Runtime. +/** + * \file + * Tracing facilities for the Mono Runtime. * * Author: * Paolo Molaro (lupus@ximian.com) @@ -25,32 +26,13 @@ #include #include "trace.h" -#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS)) +#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS)) # undef printf # define printf(...) g_log("mono", G_LOG_LEVEL_MESSAGE, __VA_ARGS__) # undef fprintf # define fprintf(__ignore, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, __VA_ARGS__) #endif -#ifdef __GNUC__ - -#define RETURN_ADDRESS_N(N) (__builtin_extract_return_addr (__builtin_return_address (N))) -#define RETURN_ADDRESS() RETURN_ADDRESS_N(0) - -#elif defined(_MSC_VER) - -#include -#pragma intrinsic(_ReturnAddress) - -#define RETURN_ADDRESS() _ReturnAddress() -#define RETURN_ADDRESS_N(N) NULL - -#else - -#error "Missing return address intrinsics implementation" - -#endif - static MonoTraceSpec trace_spec; static volatile gint32 output_lock = 0; @@ -132,11 +114,12 @@ mono_trace_eval (MonoMethod *method) case MONO_TRACEOP_EXCEPTION: break; } - if (op->exclude){ + if (op->exclude) { if (inc) include = 0; - } else if (inc) + } else if (inc) { include = 1; + } } return include; } @@ -165,9 +148,10 @@ static void get_string (void) } if (value != NULL) g_free (value); - value = (char *)g_malloc (input - start + 1); - strncpy (value, start, input-start); - value [input-start] = 0; + size_t len = input - start; + value = (char *)g_malloc (len + 1); + memcpy (value, start, len); + value [len] = 0; } enum Token {