From cb6d25acad4d012c8fda86c06048d042c160f377 Mon Sep 17 00:00:00 2001 From: thaystg Date: Thu, 26 Mar 2020 13:21:52 +0000 Subject: [PATCH] [debugger] Bump protocol for this commit https://github.com/mono/mono/pull/19248 Bump protocol for this commit https://github.com/mono/mono/pull/19248 as suggested by @vargaz. --- src/mono/mono/mini/debugger-agent.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/mono/mono/mini/debugger-agent.c b/src/mono/mono/mini/debugger-agent.c index 63d9574340f737..5e524f865efdbb 100644 --- a/src/mono/mono/mini/debugger-agent.c +++ b/src/mono/mono/mini/debugger-agent.c @@ -298,7 +298,7 @@ typedef struct { #define HEADER_LENGTH 11 #define MAJOR_VERSION 2 -#define MINOR_VERSION 55 +#define MINOR_VERSION 56 typedef enum { CMD_SET_VM = 1, @@ -6976,6 +6976,12 @@ get_types_for_source_file (gpointer key, gpointer value, gpointer user_data) } } +static void add_error_string (Buffer *buf, const char *str) +{ + if (CHECK_PROTOCOL_VERSION (2, 56)) + buffer_add_string (buf, str); +} + static ErrorCode vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) { @@ -7280,7 +7286,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) ignore_case = decode_byte (p, &p, end); if (!mono_reflection_parse_type_checked (name, &info, error)) { - buffer_add_string (buf, mono_error_get_message (error)); + add_error_string (buf, mono_error_get_message (error)); mono_error_cleanup (error); g_free (name); mono_reflection_free_type_info (&info); @@ -7791,7 +7797,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_free (s); mono_domain_set_fast (d, TRUE); char* error_msg = g_strdup_printf ("Unexpected assembly-qualified type %s was provided", original_s); - buffer_add_string (buf, error_msg); + add_error_string (buf, error_msg); g_free (error_msg); g_free (original_s); return ERR_INVALID_ARGUMENT; @@ -7803,7 +7809,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_free (s); mono_domain_set_fast (d, TRUE); char* error_msg = g_strdup_printf ("Invalid type name %s", original_s); - buffer_add_string (buf, error_msg); + add_error_string (buf, error_msg); g_free (error_msg); g_free (original_s); return ERR_INVALID_ARGUMENT; @@ -7869,7 +7875,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) error_init (error); MonoClass* mono_class = mono_class_get_checked (ass->image, token, error); if (!is_ok (error)) { - buffer_add_string (buf, mono_error_get_message (error)); + add_error_string (buf, mono_error_get_message (error)); mono_error_cleanup (error); return ERR_INVALID_ARGUMENT; } @@ -7886,7 +7892,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) error_init (error); MonoMethod* mono_method = mono_get_method_checked (ass->image, token, NULL, NULL, error); if (!is_ok (error)) { - buffer_add_string (buf, mono_error_get_message (error)); + add_error_string (buf, mono_error_get_message (error)); mono_error_cleanup (error); return ERR_INVALID_ARGUMENT; } @@ -8739,7 +8745,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g header = mono_method_get_header_checked (method, error); if (!header) { - buffer_add_string (buf, mono_error_get_message (error)); + add_error_string (buf, mono_error_get_message (error)); mono_error_cleanup (error); /* FIXME don't swallow the error */ return ERR_INVALID_ARGUMENT; } @@ -9571,7 +9577,7 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf) if (!is_ok (error)) { if (s) g_free (s); - buffer_add_string (buf, mono_error_get_message (error)); + add_error_string (buf, mono_error_get_message (error)); return ERR_INVALID_ARGUMENT; } buffer_add_string (buf, s);