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

[mono][debugger] Reverting major protocol version change to a minor version change #47872

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions src/mono/mono/mini/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -3647,7 +3647,7 @@ static void
runtime_initialized (MonoProfiler *prof)
{
process_profiler_event (EVENT_KIND_VM_START, mono_thread_current ());
if (CHECK_PROTOCOL_VERSION (3, 0))
if (CHECK_PROTOCOL_VERSION (2, 59))
process_profiler_event (EVENT_KIND_ASSEMBLY_LOAD, (mono_defaults.corlib->assembly));
if (agent_config.defer) {
ERROR_DECL (error);
Expand Down Expand Up @@ -5029,7 +5029,7 @@ buffer_add_value_full (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain,

if (!obj) {
buffer_add_byte (buf, VALUE_TYPE_ID_NULL);
if (CHECK_PROTOCOL_VERSION (3, 0)) {
if (CHECK_PROTOCOL_VERSION (2, 59)) {
buffer_add_info_for_null_value(buf, t, domain);
}
} else {
Expand Down Expand Up @@ -5924,7 +5924,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
return ERR_INVALID_ARGUMENT;
} else if (m_class_is_valuetype (m->klass) && (m->flags & METHOD_ATTRIBUTE_STATIC)) {
/* Should be null */
if (!CHECK_PROTOCOL_VERSION (3, 0)) { //on icordbg I couldn't find type information when invoking a static method maybe I can change this later
if (!CHECK_PROTOCOL_VERSION (2, 59)) { //on icordbg I couldn't find type information when invoking a static method maybe I can change this later
int type = decode_byte (p, &p, end);
if (type != VALUE_TYPE_ID_NULL) {
PRINT_DEBUG_MSG (1, "[%p] Error: Static vtype method invoked with this argument.\n", (gpointer) (gsize) mono_native_thread_id_get ());
Expand All @@ -5946,14 +5946,14 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
return err;
}
} else {
if (!(m->flags & METHOD_ATTRIBUTE_STATIC && CHECK_PROTOCOL_VERSION (3, 0))) { //on icordbg I couldn't find an object when invoking a static method maybe I can change this later
if (!(m->flags & METHOD_ATTRIBUTE_STATIC && CHECK_PROTOCOL_VERSION (2, 59))) { //on icordbg I couldn't find an object when invoking a static method maybe I can change this later
err = decode_value(m_class_get_byval_arg(m->klass), domain, this_buf, p, &p, end, FALSE);
if (err != ERR_NONE)
return err;
}
}

if (!m_class_is_valuetype (m->klass) && !(m->flags & METHOD_ATTRIBUTE_STATIC && CHECK_PROTOCOL_VERSION (3, 0))) //on icordbg I couldn't find an object when invoking a static method maybe I can change this later
if (!m_class_is_valuetype (m->klass) && !(m->flags & METHOD_ATTRIBUTE_STATIC && CHECK_PROTOCOL_VERSION (2, 59))) //on icordbg I couldn't find an object when invoking a static method maybe I can change this later
this_arg = *(MonoObject**)this_buf;
else
this_arg = NULL;
Expand Down Expand Up @@ -6733,7 +6733,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
tls->pending_invoke->endp = tls->pending_invoke->p + (end - p);
tls->pending_invoke->suspend_count = suspend_count;
tls->pending_invoke->nmethods = nmethods;
if (!CHECK_PROTOCOL_VERSION (3, 0)) { //on icordbg they send a resume after calling an invoke method
if (!CHECK_PROTOCOL_VERSION (2, 59)) { //on icordbg they send a resume after calling an invoke method
if (flags & INVOKE_FLAG_SINGLE_THREADED) {
resume_thread(THREAD_TO_INTERNAL(thread));
}
Expand Down Expand Up @@ -7540,7 +7540,7 @@ field_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
buffer_add_typeid (buf, domain, f->parent);
buffer_add_typeid (buf, domain, mono_class_from_mono_type_internal (f->type));
buffer_add_int (buf, f->type->attrs);
if (CHECK_PROTOCOL_VERSION (3, 0)) {
if (CHECK_PROTOCOL_VERSION (2, 59)) {
buffer_add_int (buf, f->type->type);
buffer_add_int (buf, m_class_get_type_token (f->parent));
buffer_add_int (buf, m_class_get_type_token (mono_class_from_mono_type_internal (f->type)));
Expand Down Expand Up @@ -7684,7 +7684,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint

while ((m = mono_class_get_methods (klass, &iter))) {
buffer_add_methodid (buf, domain, m);
if (CHECK_PROTOCOL_VERSION (3, 0))
if (CHECK_PROTOCOL_VERSION (2, 59))
buffer_add_int(buf, m->token);
i ++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/mini/debugger-protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Wire Protocol definitions
*/

#define MAJOR_VERSION 3
#define MINOR_VERSION 0
#define MAJOR_VERSION 2
#define MINOR_VERSION 59

typedef enum {
MDBGPROT_CMD_COMPOSITE = 100
Expand Down