Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kliger <aleksey@xamarin.com>2016-01-28 19:14:07 +0300
committerAleksey Kliger <aleksey@xamarin.com>2016-01-28 19:31:30 +0300
commit5297427fdfd81f23b685bcf3e6314604e1cd1c30 (patch)
tree4539f2ab257c7302176d64f8de1eaa6ab21eb743
parent205d9e09f02f5e97f24a3d2d92795cdfbbbe9fdd (diff)
[runtime] mono_error_assert_ok() include location
-rw-r--r--mono/utils/mono-error-internals.h4
-rw-r--r--mono/utils/mono-error.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/mono/utils/mono-error-internals.h b/mono/utils/mono-error-internals.h
index 926e76c9bbd..d16f9ef6602 100644
--- a/mono/utils/mono-error-internals.h
+++ b/mono/utils/mono-error-internals.h
@@ -40,7 +40,9 @@ typedef struct {
#define is_ok(error) ((error)->error_code == MONO_ERROR_NONE)
void
-mono_error_assert_ok (MonoError *error);
+mono_error_assert_ok_pos (MonoError *error, const char* filename, int lineno);
+
+#define mono_error_assert_ok(e) mono_error_assert_ok_pos (e, __FILE__, __LINE__);
void
mono_error_dup_strings (MonoError *error, gboolean dup_strings);
diff --git a/mono/utils/mono-error.c b/mono/utils/mono-error.c
index ca3350c5fd4..9cbd73dde2d 100644
--- a/mono/utils/mono-error.c
+++ b/mono/utils/mono-error.c
@@ -119,12 +119,12 @@ mono_error_ok (MonoError *error)
}
void
-mono_error_assert_ok (MonoError *error)
+mono_error_assert_ok_pos (MonoError *error, const char* filename, int lineno)
{
if (mono_error_ok (error))
return;
- g_error ("%s\n", mono_error_get_message (error));
+ g_error ("%s:%d: %s\n", filename, lineno, mono_error_get_message (error));
}
unsigned short