Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debugger] Bump protocol for this commit https://github.com/mono/mono/pull/19248 #34070

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/mono/mono/mini/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down