projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[sgen] Evacuate from emptier blocks to fuller ones
[mono.git]
/
mono
/
metadata
/
attach.c
diff --git
a/mono/metadata/attach.c
b/mono/metadata/attach.c
index 71e87e1c577f09e113fdc7ca9dba54647a044b44..45c3da535940aa408e9d54d699273f3e94370fbf 100644
(file)
--- a/
mono/metadata/attach.c
+++ b/
mono/metadata/attach.c
@@
-37,7
+37,7
@@
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/threads-types.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internal
s
.h>
#include <mono/utils/mono-threads.h>
#include "attach.h"
#include <mono/utils/mono-threads.h>
#include "attach.h"
@@
-99,10
+99,6
@@
static gboolean stop_receiver_thread;
static gboolean needs_to_start, started;
static gboolean needs_to_start, started;
-#define agent_lock() mono_mutex_lock (&agent_mutex)
-#define agent_unlock() mono_mutex_unlock (&agent_mutex)
-static mono_mutex_t agent_mutex;
-
static void transport_connect (void);
static guint32 WINAPI receiver_thread (void *arg);
static void transport_connect (void);
static guint32 WINAPI receiver_thread (void *arg);
@@
-156,7
+152,7
@@
decode_string_value (guint8 *buf, guint8 **endbuf, guint8 *limit)
g_assert (length < (1 << 16));
g_assert (length < (1 << 16));
- s = g_malloc (length + 1);
+ s =
(char *)
g_malloc (length + 1);
g_assert (p + length <= limit);
memcpy (s, p, length);
g_assert (p + length <= limit);
memcpy (s, p, length);
@@
-184,8
+180,6
@@
mono_attach_parse_options (char *options)
void
mono_attach_init (void)
{
void
mono_attach_init (void)
{
- mono_mutex_init_recursive (&agent_mutex);
-
config.enabled = TRUE;
}
config.enabled = TRUE;
}
@@
-271,6
+265,7
@@
mono_attach_cleanup (void)
static int
mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject **exc)
{
static int
mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject **exc)
{
+ MonoError error;
MonoAssembly *agent_assembly;
MonoImage *image;
MonoMethod *method;
MonoAssembly *agent_assembly;
MonoImage *image;
MonoMethod *method;
@@
-298,9
+293,10
@@
mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject
return 1;
}
return 1;
}
- method = mono_get_method
(image, entry, NULL
);
+ method = mono_get_method
_checked (image, entry, NULL, NULL, &error
);
if (method == NULL){
if (method == NULL){
- g_print ("The entry point method of assembly '%s' could not be loaded\n", agent);
+ g_print ("The entry point method of assembly '%s' could not be loaded due to %s\n", agent, mono_error_get_message (&error));
+ mono_error_cleanup (&error);
g_free (agent);
return 1;
}
g_free (agent);
return 1;
}
@@
-315,7
+311,8
@@
mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject
g_free (agent);
pa [0] = main_args;
g_free (agent);
pa [0] = main_args;
- mono_runtime_invoke (method, NULL, pa, exc);
+ mono_runtime_try_invoke (method, NULL, pa, exc, &error);
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
return 0;
}
return 0;
}
@@
-530,7
+527,7
@@
receiver_thread (void *arg)
content_len = decode_int (p, &p, p_end);
/* Read message body */
content_len = decode_int (p, &p, p_end);
/* Read message body */
- body = g_malloc (content_len);
+ body =
(guint8 *)
g_malloc (content_len);
res = read (conn_fd, body, content_len);
p = body;
res = read (conn_fd, body, content_len);
p = body;