}
}
+ public struct TestStruct7
+ {
+ public int val1
+ {
+ get
+ {
+ return 567;
+ }
+ }
+
+ public int val2
+ {
+ get
+ {
+ try {
+ throw new System.DivideByZeroException();
+ }
+ catch
+ {
+ return 777;
+ }
+ return 888;
+ }
+ }
+
+ public int val3
+ {
+ get
+ {
+ throw new System.DivideByZeroException();
+ return 777;
+ }
+ }
+
+ public string val4
+ {
+ get
+ {
+ return "text_567";
+ }
+ }
+ }
+
class Program
{
static void Main(string[] args)
Context.InsertBreakpoint(DebuggeeInfo.Breakpoints["BREAK4"], 7);
Context.InsertBreakpoint(DebuggeeInfo.Breakpoints["BREAK5"], 8);
Context.InsertBreakpoint(DebuggeeInfo.Breakpoints["BREAK6"], 9);
+ Context.InsertBreakpoint(DebuggeeInfo.Breakpoints["BREAK7"], 10);
Assert.Equal(MIResultClass.Running,
- Context.MIDebugger.Request("10-exec-continue").Class);
+ Context.MIDebugger.Request("11-exec-continue").Class);
});
TestStruct2 ts = new TestStruct2(1, 5, 10);
int dummy6 = 6; Label.Breakpoint("BREAK6");
- Label.Checkpoint("test_eval_timeout", "finish", () => {
+ Label.Checkpoint("test_eval_timeout", "test_eval_with_exception", () => {
Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["BREAK6"]);
var task = System.Threading.Tasks.Task.Run(() =>
Context.MIDebugger.Request("-exec-continue").Class);
});
+ TestStruct7 ts7 = new TestStruct7();
+
+ int dummy7 = 7; Label.Breakpoint("BREAK7");
+
+ Label.Checkpoint("test_eval_with_exception", "finish", () => {
+ Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["BREAK7"]);
+
+ Assert.Equal("567", Context.GetChildValue("ts7", 0, false, 0));
+ Assert.Equal("777", Context.GetChildValue("ts7", 1, false, 0));
+ Assert.Equal("{System.DivideByZeroException}", Context.GetChildValue("ts7", 2, false, 0));
+ Assert.Equal("\\\"text_567\\\"", Context.GetChildValue("ts7", 3, false, 0));
+
+ Assert.Equal(MIResultClass.Running,
+ Context.MIDebugger.Request("-exec-continue").Class);
+ });
+
Label.Checkpoint("finish", "", () => {
Context.WasExit();
Context.DebuggerExit();
Context.AddBreakpoint("bp2");
Context.AddBreakpoint("bp3");
Context.AddBreakpoint("bp4");
+ Context.AddBreakpoint("bp5");
Context.AddBreakpoint("bp_func");
Context.SetBreakpoints();
Context.PrepareEnd();
Label.Checkpoint("bp_test", "bp_func_test", () => {
Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["bp"]);
Int64 frameId = Context.DetectFrameId(DebuggeeInfo.Breakpoints["bp"]);
- Context.CheckVariablesCount(frameId, "Locals", 6);
+ Context.CheckVariablesCount(frameId, "Locals", 7);
int variablesReference = Context.GetVariablesReference(frameId, "Locals");
Context.EvalVariable(variablesReference, "string[]", "args" , "{string[0]}");
Context.EvalVariable(variablesReference, "int", "i", "2");
i++; Label.Breakpoint("bp4");
- Label.Checkpoint("test_eval_timeout", "finish", () => {
+ Label.Checkpoint("test_eval_timeout", "test_eval_exception", () => {
Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["bp4"]);
Int64 frameId = Context.DetectFrameId(DebuggeeInfo.Breakpoints["bp4"]);
Context.Continue();
});
+ TestStruct7 ts7 = new TestStruct7();
+
+ i++; Label.Breakpoint("bp5");
+
+ Label.Checkpoint("test_eval_exception", "finish", () => {
+ Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["bp5"]);
+ Int64 frameId = Context.DetectFrameId(DebuggeeInfo.Breakpoints["bp5"]);
+
+ int variablesReference_Locals = Context.GetVariablesReference(frameId, "Locals");
+ int variablesReference_ts7 = Context.GetChildVariablesReference(variablesReference_Locals, "ts7");
+
+ Context.EvalVariable(variablesReference_ts7, "int", "val1", "567");
+ Context.EvalVariable(variablesReference_ts7, "int", "val2", "777");
+ Context.EvalVariable(variablesReference_ts7, "System.DivideByZeroException", "val3", "{System.DivideByZeroException}");
+ Context.EvalVariable(variablesReference_ts7, "string", "val4", "\"text_567\"");
+
+ Context.EvalVariableByIndex(variablesReference_ts7, "int", 0, "567");
+ Context.EvalVariableByIndex(variablesReference_ts7, "int", 1, "777");
+ Context.EvalVariableByIndex(variablesReference_ts7, "System.DivideByZeroException", 2, "{System.DivideByZeroException}");
+ Context.EvalVariableByIndex(variablesReference_ts7, "string", 3, "\"text_567\"");
+
+ Context.Continue();
+ });
+
Label.Checkpoint("finish", "", () => {
Context.WasExit();
Context.DebuggerExit();
}
}
}
+
+ public struct TestStruct7
+ {
+ public int val1
+ {
+ get
+ {
+ return 567;
+ }
+ }
+
+ public int val2
+ {
+ get
+ {
+ try {
+ throw new System.DivideByZeroException();
+ }
+ catch
+ {
+ return 777;
+ }
+ return 888;
+ }
+ }
+
+ public int val3
+ {
+ get
+ {
+ throw new System.DivideByZeroException();
+ return 777;
+ }
+ }
+
+ public string val4
+ {
+ get
+ {
+ return "text_567";
+ }
+ }
+ }
}
}