public bool Exec(Hooker hooker, Thread th) { PrintRes res = new PrintRes(); res.m_name = m_name; var segments = m_name.Split('.'); object obj = th.GetObjByName(segments[0], m_stack_idx); for (int i = 1; i < segments.Length; ++i) { if (obj is IGetSet) { obj = (obj as IGetSet).Get(segments[i]); } else { obj = null; break; } } if (obj != null) { res.m_type_name = obj.GetType().Name; res.m_value_str = obj.ToString(); } else { res.m_type_name = "null"; res.m_value_str = "nil"; } hooker.SendResponse(res); return(false); }
public bool Exec(Hooker hooker, Thread th) { GetFrameInfoRes res = new GetFrameInfoRes(); th.FillFrameInfo(res, m_stack_idx); hooker.SendResponse(res); return(false); }
public bool Exec(Hooker hooker, Thread th) { var frames = th.GetBackTraceInfo(); BackTraceRes res = new BackTraceRes(); res.m_frames = frames; hooker.SendResponse(res); return(false); }
public string m_file = "";// for reset public bool Exec(Hooker hooker, Thread th) { BreakOpRes res = new BreakOpRes(); if (m_cmd_mode == BreakCmdMode.Set) { for (int i = 0; i < m_break_points.Count; ++i) { hooker.AddBreakPoint(m_break_points[i]); } res.m_head_desc = "Add BreakPoint:"; res.m_break_points = m_break_points; } else if (m_cmd_mode == BreakCmdMode.ResetOneFile) { hooker.ResetBreakPointForOneFile(m_file, m_break_points); res.m_head_desc = "Reset BreakPoint:"; res.m_break_points = m_break_points; } else if (m_cmd_mode == BreakCmdMode.Delete) { res.m_head_desc = "Remove BreakPoint:"; for (int i = 0; i < m_break_points.Count; ++i) { var point = hooker.RemoveBreakPointByIndex(m_break_points[i].index); if (point != null) { res.m_break_points.Add(m_break_points[i]); } } } else if (m_cmd_mode == BreakCmdMode.DeleteAll) { hooker.ClearBreakPoint(); res.m_head_desc = "Clear BreakPoint"; } else if (m_cmd_mode == BreakCmdMode.List) { res.m_break_points.AddRange(hooker.GetBreakPoint()); res.m_head_desc = "List BreakPoint (" + res.m_break_points.Count + "):"; } hooker.SendResponse(res); return(false); }