Skip to content

Commit

Permalink
[debugger] Add intrinsic for creating a byte array (mono/mono#15591)
Browse files Browse the repository at this point in the history
Fixes mono/mono#15268



Commit migrated from mono/mono@4917c08
  • Loading branch information
thaystg authored and akoeplinger committed Jul 10, 2019
1 parent d7f0804 commit 555fe7a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/mono/mono/mini/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ typedef enum {
CMD_APPDOMAIN_GET_ENTRY_ASSEMBLY = 4,
CMD_APPDOMAIN_CREATE_STRING = 5,
CMD_APPDOMAIN_GET_CORLIB = 6,
CMD_APPDOMAIN_CREATE_BOXED_VALUE = 7
CMD_APPDOMAIN_CREATE_BOXED_VALUE = 7,
CMD_APPDOMAIN_CREATE_BYTE_ARRAY = 8,
} CmdAppDomain;

typedef enum {
Expand Down Expand Up @@ -7219,6 +7220,21 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
buffer_add_objid (buf, (MonoObject*)o);
break;
}
case CMD_APPDOMAIN_CREATE_BYTE_ARRAY: {
ERROR_DECL (error);
MonoArray *arr;
gpointer elem;
domain = decode_domainid (p, &p, end, NULL, &err);
uintptr_t size = 0;
int len = decode_int (p, &p, end);
size = len;
arr = mono_array_new_full_checked (mono_domain_get (), mono_class_create_array (mono_get_byte_class(), 1), &size, NULL, error);
elem = mono_array_addr_internal (arr, guint8, 0);
memcpy (elem, p, len);
p += len;
buffer_add_objid (buf, (MonoObject*) arr);
break;
}
case CMD_APPDOMAIN_CREATE_BOXED_VALUE: {
ERROR_DECL (error);
MonoClass *klass;
Expand Down Expand Up @@ -9377,7 +9393,8 @@ static const char* appdomain_cmds_str[] = {
"GET_ENTRY_ASSEMBLY",
"CREATE_STRING",
"GET_CORLIB",
"CREATE_BOXED_VALUE"
"CREATE_BOXED_VALUE",
"CREATE_BYTE_ARRAY",
};

static const char* assembly_cmds_str[] = {
Expand Down

0 comments on commit 555fe7a

Please sign in to comment.