void content_OnEditCellComplete(int column, string oldValue, string newValue, DbgObject context, ref bool cancel) { if (column == 0) //change watch variable name { bool evalRefreshRequest = (newValue != null && newValue.IsInvokeExpression()); if (oldValue != newValue || evalRefreshRequest) { if (!string.IsNullOrEmpty(oldValue)) { Debugger.RemoveWatch(oldValue); } if (!string.IsNullOrEmpty(newValue)) { Debugger.AddWatch(newValue); } } } else if (column == 1) //set value { Debugger.InvokeResolve("resolve", context.Name + "=" + newValue.Trim()); cancel = true; //debugger will send the update with the fresh actual value } }
private void ReevaluateAll() { if (Debugger.IsInBreak) { this.InUiThread( () => { // too harsh. ideally need some more gentle update // content.ResetAll(); var items = content.GetItems(); var subItems = items.Where(i => i.Name != i.Path && (i.Parent.IsCollection || i.IsArray)); items = items.Except(subItems).ToArray(); // need to clear only collections items.ForEach((DbgObject item) => { item.Children = null; item.IsExpanded = false; Debugger.RemoveWatch(item.Path); Debugger.AddWatch(item.Path); }); // subitems are not true watch // items but their dynamically explored children. // tracking them on debug steps is extremely difficult. // So close them and reopen as needed. // If a child item needs to be watched so pin it. content.RemoveSubItems(collectionsOnly: true); }); } }
void listView1_MouseDown(object sender, MouseEventArgs e) { ListViewHitTestInfo info = listView1.HitTest(e.X, e.Y); if (info.Item != null) { int colIndex = GetColumnFromOffset(e.X); if (colIndex == 0) { if (GetItemExpenderClickableRange(info.Item).Contains(e.X)) { OnExpandItem(info.Item); } var dbgObject = (DbgObject)info.Item.Tag; if (dbgObject != null && dbgObject.IsPinable && IsPinnable) { if (GetItemPinClickableRange().Contains(e.X)) { if (OnPinClicked != null) { OnPinClicked(dbgObject); } } } } else if (colIndex == 1) { var dbgObject = (DbgObject)info.Item.Tag; if (dbgObject != null) { if (GetItemVisualizerClickableRange().Contains(e.X)) { if (dbgObject.IsRefreshable && !dbgObject.IsCurrent) { if (Debugger.IsInBreak) { Debugger.AddWatch(dbgObject.Name); } } else if (dbgObject.IsVisualizable) { using (var panel = new TextVisualizer(dbgObject.Name, dbgObject.Value.StripQuotation().Replace("\r", "").Replace("\n", "\r\n"))) { if (dbgObject.IsCollection) { panel.InitAsCollection(dbgObject.DbgId); } panel.ShowDialog(); } } } } } } }
public void AddWatchExpression(string expression, bool sendToDebugger = true) { expression = expression.Trim(); if (!string.IsNullOrEmpty(expression)) { AddWatchObject(new DbgObject { DbgId = "", Name = expression, IsExpression = true, Value = "<N/A>", Type = "<N/A>", }); if (sendToDebugger) { Debugger.AddWatch(expression); } } }
private void Content_ReevaluateRequest(DbgObject context) { Debugger.RemoveWatch(context.Name); Debugger.AddWatch(context.Name); }