bool CheckBreakpoint(int handle) { BreakEventInfo binfo; if (!breakpoints.TryGetValue(handle, out binfo)) { return(true); } Breakpoint bp = (Breakpoint)binfo.BreakEvent; if (!string.IsNullOrEmpty(bp.ConditionExpression) && bp.BreakIfConditionChanges) { // Update the condition expression GdbCommandResult res = RunCommand("-data-evaluate-expression", Escape(bp.ConditionExpression)); string val = res.GetValue("value"); RunCommand("-break-condition", handle.ToString(), "(" + bp.ConditionExpression + ") != " + val); } if (bp.HitAction == HitAction.PrintExpression) { GdbCommandResult res = RunCommand("-data-evaluate-expression", Escape(bp.TraceExpression)); string val = res.GetValue("value"); NotifyBreakEventUpdate(binfo, 0, val); return(false); } return(true); }
protected override Backtrace OnGetThreadBacktrace(long processId, long threadId) { ResultData data = SelectThread(threadId); GdbCommandResult res = RunCommand("-stack-info-depth"); int fcount = int.Parse(res.GetValue("depth")); GdbBacktrace bt = new GdbBacktrace(this, threadId, fcount, data != null ? data.GetObject("frame") : null); return(new Backtrace(bt)); }
ObjectValue CreateVarObject(string exp) { try { session.SelectThread(threadId); exp = exp.Replace("\"", "\\\""); GdbCommandResult res = session.RunCommand("-var-create", "-", "*", "\"" + exp + "\""); string vname = res.GetValue("name"); session.RegisterTempVariableObject(vname); return(CreateObjectValue(exp, res)); } catch { return(ObjectValue.CreateUnknown(exp)); } }
protected override void OnFinish() { SelectThread(activeThread); GdbCommandResult res = RunCommand("-stack-info-depth", "2"); if (res.GetValue("depth") == "1") { RunCommand("-exec-continue"); } else { RunCommand("-stack-select-frame", "0"); RunCommand("-exec-finish"); } }
void FireTargetEvent(TargetEventType type, ResultData curFrame) { UpdateHitCountData(); TargetEventArgs args = new TargetEventArgs(type); if (type != TargetEventType.TargetExited) { GdbCommandResult res = RunCommand("-stack-info-depth"); int fcount = int.Parse(res.GetValue("depth")); GdbBacktrace bt = new GdbBacktrace(this, activeThread, fcount, curFrame); args.Backtrace = new Backtrace(bt); args.Thread = GetThread(activeThread); } OnTargetEvent(args); }