static void suspend_init (void);
-static void ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint *sp, MonoSeqPointInfo *info);
+static void ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint *sp, MonoSeqPointInfo *info, MonoContext *ctx, DebuggerTlsData *tls);
static ErrorCode ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, EventRequest *req);
static void ss_destroy (SingleStepReq *req);
} else if (strncmp (arg, "onthrow=", 8) == 0) {
/* We support multiple onthrow= options */
agent_config.onthrow = g_slist_append (agent_config.onthrow, g_strdup (arg + 8));
+ } else if (strncmp (arg, "onthrow", 7) == 0) {
+ agent_config.onthrow = g_slist_append (agent_config.onthrow, g_strdup (""));
} else if (strncmp (arg, "help", 4) == 0) {
print_usage ();
exit (0);
break;
}
+#ifndef PLATFORM_WIN32
+ /*
+ * this function is not present on win2000 which we still support, and the
+ * workaround described here:
+ * http://msdn.microsoft.com/en-us/library/ms737931(VS.85).aspx
+ * only works with MSVC.
+ */
freeaddrinfo (result);
+#endif
}
DEBUG (1, fprintf (log_file, "Listening on %s:%d (timeout=%d ms)...\n", host, port, agent_config.timeout));
conn_fd = sfd;
+#ifndef PLATFORM_WIN32
+ /* See the comment above */
freeaddrinfo (result);
+#endif
if (rp == 0) {
fprintf (stderr, "debugger-agent: Unable to connect to %s:%d\n", host, port);
g_ptr_array_add (ss_reqs, req);
/* Start single stepping again from the current sequence point */
- ss_start (ss_req, ji->method, sp, info);
+ ss_start (ss_req, ji->method, sp, info, ctx, NULL);
}
if (ss_reqs->len > 0)
* Start the single stepping operation given by SS_REQ from the sequence point SP.
*/
static void
-ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint *sp, MonoSeqPointInfo *info)
+ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint *sp, MonoSeqPointInfo *info, MonoContext *ctx, DebuggerTlsData *tls)
{
gboolean use_bp = FALSE;
- int i;
+ int i, frame_index;
SeqPoint *next_sp;
MonoBreakpoint *bp;
* Implement single stepping using breakpoints if possible.
*/
if (ss_req->depth == STEP_DEPTH_OVER) {
- if (sp->next_len > 0) {
+ frame_index = 1;
+ /*
+ * Find the first sequence point in the current or in a previous frame which
+ * is not the last in its method.
+ */
+ while (sp && sp->next_len == 0) {
+ sp = NULL;
+ if (tls && frame_index < tls->frame_count) {
+ StackFrame *frame = tls->frames [frame_index];
+
+ method = frame->method;
+ if (frame->il_offset != -1) {
+ sp = find_seq_point (frame->domain, frame->method, frame->il_offset, &info);
+ }
+ frame_index ++;
+ }
+ }
+
+ if (sp && sp->next_len > 0) {
use_bp = TRUE;
for (i = 0; i < sp->next_len; ++i) {
next_sp = &info->seq_points [sp->next [i]];
}
}
- ss_start (ss_req, method, sp, info);
+ ss_start (ss_req, method, sp, info, NULL, tls);
return 0;
}
char *ex_type = l->data;
char *f = mono_type_full_name (&exc->object.vtable->klass->byval_arg);
- if (!strcmp (ex_type, f))
+ if (!strcmp (ex_type, "") || !strcmp (ex_type, f))
found = TRUE;
g_free (f);
int err;
int type = decode_byte (buf, &buf, limit);
- if (type != t->type && !MONO_TYPE_IS_REFERENCE (t)) {
- DEBUG(1, fprintf (log_file, "Expected value of type %d, got %d.\n", t->type, type));
+ if (type != t->type && !MONO_TYPE_IS_REFERENCE (t) &&
+ !(t->type == MONO_TYPE_I && type == MONO_TYPE_VALUETYPE) &&
+ !(t->type == MONO_TYPE_U && type == MONO_TYPE_VALUETYPE) &&
+ !(t->type == MONO_TYPE_PTR && type == MONO_TYPE_I8)) {
+ DEBUG(1, fprintf (log_file, "[%p] Expected value of type 0x%0x, got 0x%0x.\n", (gpointer)GetCurrentThreadId (), t->type, type));
return ERR_INVALID_ARGUMENT;
}
case MONO_TYPE_R8:
*(guint64*)addr = decode_long (buf, &buf, limit);
break;
+ case MONO_TYPE_PTR:
+ /* We send these as I8, so we get them back as such */
+ g_assert (type == MONO_TYPE_I8);
+ *(gssize*)addr = decode_long (buf, &buf, limit);
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ /* We send these as vtypes, so we get them back as such */
+ g_assert (type == MONO_TYPE_VALUETYPE);
+ /* Fall through */
case MONO_TYPE_VALUETYPE: {
gboolean is_enum = decode_byte (buf, &buf, limit);
MonoClass *klass;