[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void locals () {
locals1 (null);
- locals2 (null, 5);
+ locals2<string> (null, 5, "ABC");
locals3 ();
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
- public static void locals2 (string[] args, int arg) {
+ public static void locals2<T> (string[] args, int arg, T t) {
long i = 42;
string s = "AB";
for (int j = 0; j < 10; ++j) {
if (s != null)
i ++;
+ if (t != null)
+ i ++;
}
}
}
Assert.IsInstanceOfType (typeof (BreakpointEvent), e);
- Assert.AreEqual (m, (e as BreakpointEvent).Method);
+ Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
return (e as BreakpointEvent);
}
}
[Test]
- [Category ("only")]
public void Type_SetValue () {
var e = run_until ("o1");
var frame = e.Thread.GetFrames () [0];
StackFrame frame = e.Thread.GetFrames () [0];
var locals = frame.Method.GetLocals ();
- Assert.AreEqual (5, locals.Length);
- for (int i = 0; i < 5; ++i) {
+ Assert.AreEqual (6, locals.Length);
+ for (int i = 0; i < 6; ++i) {
if (locals [i].Name == "args") {
Assert.IsTrue (locals [i].IsArg);
Assert.AreEqual ("String[]", locals [i].Type.Name);
} else if (locals [i].Name == "s") {
Assert.IsFalse (locals [i].IsArg);
Assert.AreEqual ("String", locals [i].Type.Name);
+ } else if (locals [i].Name == "t") {
+ // gshared
+ Assert.IsTrue (locals [i].IsArg);
+ Assert.AreEqual ("String", locals [i].Type.Name);
} else {
Assert.Fail ();
}
}
[Test]
+ [Category ("only")]
public void Locals () {
var be = run_until ("locals1");
AssertValue (42, vals [i]);
if (locals [i].Name == "s")
AssertValue ("AB", vals [i]);
+ if (locals [i].Name == "t")
+ AssertValue ("ABC", vals [i]);
}
// Argument checking
}
[Test]
- [Category ("only")]
public void CreateBoxedValue () {
ObjectMirror o = vm.RootDomain.CreateBoxedValue (new PrimitiveValue (vm, 42));
}
[Test]
+ [Category ("only")]
public void Frame_SetValue () {
Event e = run_until ("locals2");
frame.SetValue (p, vm.CreateValue (7));
AssertValue (7, frame.GetValue (p));
+ // gshared
+ p = frame.Method.GetParameters ()[2];
+ frame.SetValue (p, vm.RootDomain.CreateString ("DEF"));
+ AssertValue ("DEF", frame.GetValue (p));
+
// argument checking
// variable null
guint32 il_offset;
MonoDomain *domain;
MonoMethod *method;
+ /*
+ * If method is gshared, this is the actual instance, otherwise this is equal to
+ * method.
+ */
+ MonoMethod *actual_method;
MonoContext ctx;
MonoDebugMethodJitInfo *jit;
int flags;
{
ComputeFramesUserData *ud = user_data;
StackFrame *frame;
- MonoMethod *method;
+ MonoMethod *method, *actual_method;
if (info->type != FRAME_TYPE_MANAGED) {
if (info->type == FRAME_TYPE_DEBUGGER_INVOKE) {
method = info->ji->method;
else
method = info->method;
+ actual_method = info->actual_method;
if (!method || (method->wrapper_type && method->wrapper_type != MONO_WRAPPER_DYNAMIC_METHOD))
return FALSE;
frame = g_new0 (StackFrame, 1);
frame->method = method;
+ frame->actual_method = actual_method;
frame->il_offset = info->il_offset;
if (ctx) {
frame->ctx = *ctx;
buffer_add_int (buf, tls->frame_count);
for (i = 0; i < tls->frame_count; ++i) {
buffer_add_int (buf, tls->frames [i]->id);
- buffer_add_methodid (buf, tls->frames [i]->domain, tls->frames [i]->method);
+ buffer_add_methodid (buf, tls->frames [i]->domain, tls->frames [i]->actual_method);
buffer_add_int (buf, tls->frames [i]->il_offset);
/*
* Instead of passing the frame type directly to the client, we associate
}
jit = frame->jit;
- sig = mono_method_signature (frame->method);
+ sig = mono_method_signature (frame->actual_method);
switch (command) {
case CMD_STACK_FRAME_GET_VALUES: {
frame.il_offset = il_offset;
+ if (frame.ji)
+ frame.actual_method = get_method_from_stack_frame (frame.ji, get_generic_info_from_stack_frame (frame.ji, &ctx));
+ else
+ frame.actual_method = frame.method;
+
if (func (&frame, &ctx, user_data))
return;
* to native code, or the method which was JITted.
*/
MonoMethod *method;
+ /*
+ * If ji->method is a gshared method, this is the actual method instance.
+ */
+ MonoMethod *actual_method;
/* The domain containing the code executed by this frame */
MonoDomain *domain;
gboolean managed;