|
@@ -54,6 +54,8 @@ namespace IDE.ui
|
|
public bool mIsNewExpression;
|
|
public bool mIsNewExpression;
|
|
public bool mIsPending;
|
|
public bool mIsPending;
|
|
public bool mUsedLock;
|
|
public bool mUsedLock;
|
|
|
|
+ public bool? mAutoRefresh;
|
|
|
|
+ public int32 mDebuggerStateIdx;
|
|
public int32 mCurStackIdx;
|
|
public int32 mCurStackIdx;
|
|
public int mMemoryBreakpointAddr;
|
|
public int mMemoryBreakpointAddr;
|
|
public int32 mHadStepCount;
|
|
public int32 mHadStepCount;
|
|
@@ -66,6 +68,24 @@ namespace IDE.ui
|
|
public int32 mSeriesFirstVersion = -1;
|
|
public int32 mSeriesFirstVersion = -1;
|
|
public int32 mSeriesVersion = -1;
|
|
public int32 mSeriesVersion = -1;
|
|
|
|
|
|
|
|
+ public bool AutoRefresh
|
|
|
|
+ {
|
|
|
|
+ get
|
|
|
|
+ {
|
|
|
|
+ if (mAutoRefresh != null)
|
|
|
|
+ return mAutoRefresh.Value;
|
|
|
|
+ return gApp.mSettings.mDebuggerSettings.mAutoRefreshWatches;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ set
|
|
|
|
+ {
|
|
|
|
+ if (value == gApp.mSettings.mDebuggerSettings.mAutoRefreshWatches)
|
|
|
|
+ mAutoRefresh = null;
|
|
|
|
+ else
|
|
|
|
+ mAutoRefresh = value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public bool IsConstant
|
|
public bool IsConstant
|
|
{
|
|
{
|
|
get
|
|
get
|
|
@@ -1968,7 +1988,32 @@ namespace IDE.ui
|
|
{
|
|
{
|
|
mWatchRefreshButton = new WatchRefreshButton();
|
|
mWatchRefreshButton = new WatchRefreshButton();
|
|
mWatchRefreshButton.Resize(GS!(-16), 0, GS!(20), GS!(20));
|
|
mWatchRefreshButton.Resize(GS!(-16), 0, GS!(20), GS!(20));
|
|
- mWatchRefreshButton.mOnMouseDown.Add(new (evt) => RefreshWatch());
|
|
|
|
|
|
+ mWatchRefreshButton.mOnMouseDown.Add(new (evt) =>
|
|
|
|
+ {
|
|
|
|
+ if (evt.mBtn == 0)
|
|
|
|
+ RefreshWatch();
|
|
|
|
+ if (evt.mBtn == 1)
|
|
|
|
+ {
|
|
|
|
+ Menu menu = new Menu();
|
|
|
|
+ Menu anItem;
|
|
|
|
+ anItem = menu.AddItem("Refresh");
|
|
|
|
+ anItem.mOnMenuItemSelected.Add(new (item) => { RefreshWatch(); });
|
|
|
|
+
|
|
|
|
+ anItem = menu.AddItem("Auto Refresh");
|
|
|
|
+ if (mWatchEntry.AutoRefresh)
|
|
|
|
+ anItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Check);
|
|
|
|
+ anItem.mOnMenuItemSelected.Add(new (item) =>
|
|
|
|
+ {
|
|
|
|
+ mWatchEntry.AutoRefresh = !mWatchEntry.AutoRefresh;
|
|
|
|
+ if (mWatchEntry.AutoRefresh)
|
|
|
|
+ RefreshWatch();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ MenuWidget menuWidget = ThemeFactory.mDefault.CreateMenuWidget(menu);
|
|
|
|
+ menuWidget.Init(mWatchRefreshButton, evt.mX, mHeight + GS!(2));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
var typeSubItem = GetSubItem(columnIdx);
|
|
var typeSubItem = GetSubItem(columnIdx);
|
|
typeSubItem.AddWidget(mWatchRefreshButton);
|
|
typeSubItem.AddWidget(mWatchRefreshButton);
|
|
mListView.mListSizeDirty = true;
|
|
mListView.mListSizeDirty = true;
|
|
@@ -2024,7 +2069,7 @@ namespace IDE.ui
|
|
|
|
|
|
if ((mDisabled) && (allowRefresh))
|
|
if ((mDisabled) && (allowRefresh))
|
|
{
|
|
{
|
|
- AddRefreshButton();
|
|
|
|
|
|
+ AddRefreshButton();
|
|
}
|
|
}
|
|
else if (mWatchRefreshButton != null)
|
|
else if (mWatchRefreshButton != null)
|
|
{
|
|
{
|
|
@@ -2061,7 +2106,7 @@ namespace IDE.ui
|
|
return retVal;
|
|
return retVal;
|
|
}
|
|
}
|
|
|
|
|
|
- void RefreshWatch()
|
|
|
|
|
|
+ public void RefreshWatch()
|
|
{
|
|
{
|
|
var parentWatchListViewItem = mParentItem as WatchListViewItem;
|
|
var parentWatchListViewItem = mParentItem as WatchListViewItem;
|
|
if (parentWatchListViewItem != null)
|
|
if (parentWatchListViewItem != null)
|
|
@@ -2997,7 +3042,12 @@ namespace IDE.ui
|
|
for (WatchListViewItem watchListViewItem in childItems)
|
|
for (WatchListViewItem watchListViewItem in childItems)
|
|
{
|
|
{
|
|
var watchEntry = watchListViewItem.mWatchEntry;
|
|
var watchEntry = watchListViewItem.mWatchEntry;
|
|
- data.Add(watchEntry.mEvalStr);
|
|
|
|
|
|
+ using (data.CreateObject())
|
|
|
|
+ {
|
|
|
|
+ data.Add("EvalStr", watchEntry.mEvalStr);
|
|
|
|
+ if (watchEntry.mAutoRefresh != null)
|
|
|
|
+ data.Add("AutoRefresh", watchEntry.mAutoRefresh.Value);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3017,14 +3067,23 @@ namespace IDE.ui
|
|
IDEUtils.DeserializeListViewState(data, mListView);
|
|
IDEUtils.DeserializeListViewState(data, mListView);
|
|
for (let itemKey in data.Enumerate("Items"))
|
|
for (let itemKey in data.Enumerate("Items"))
|
|
{
|
|
{
|
|
- //for (int32 watchIdx = 0; watchIdx < data.Count; watchIdx++)
|
|
|
|
- //for (var watchKV in data)
|
|
|
|
- {
|
|
|
|
- String watchEntry = scope String();
|
|
|
|
- //data.GetString(watchIdx, watchEntry);
|
|
|
|
- data.GetCurString(watchEntry);
|
|
|
|
- AddWatch(watchEntry);
|
|
|
|
- }
|
|
|
|
|
|
+ String watchEntry = scope String();
|
|
|
|
+ data.GetCurString(watchEntry);
|
|
|
|
+ WatchListViewItem watchItem;
|
|
|
|
+
|
|
|
|
+ if (!watchEntry.IsEmpty)
|
|
|
|
+ {
|
|
|
|
+ watchItem = AddWatch(watchEntry);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ data.GetString("EvalStr", watchEntry);
|
|
|
|
+ watchItem = AddWatch(watchEntry);
|
|
|
|
+ if (data.Contains("AutoRefresh"))
|
|
|
|
+ {
|
|
|
|
+ watchItem.mWatchEntry.mAutoRefresh = data.GetBool("AutoRefresh");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return true;
|
|
return true;
|
|
@@ -3622,6 +3681,12 @@ namespace IDE.ui
|
|
}
|
|
}
|
|
else if (watch.mEvalStr.Length > 0)
|
|
else if (watch.mEvalStr.Length > 0)
|
|
{
|
|
{
|
|
|
|
+ if (!gApp.mDebugger.IsPaused())
|
|
|
|
+ {
|
|
|
|
+ // Keep waiting
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
String evalStr = scope String(1024);
|
|
String evalStr = scope String(1024);
|
|
if (watch.mStackFrameId != null)
|
|
if (watch.mStackFrameId != null)
|
|
{
|
|
{
|
|
@@ -3637,6 +3702,7 @@ namespace IDE.ui
|
|
DebugManager.EvalExpressionFlags flags = .AllowStringView;
|
|
DebugManager.EvalExpressionFlags flags = .AllowStringView;
|
|
if (watch.mIsNewExpression)
|
|
if (watch.mIsNewExpression)
|
|
flags |= .AllowSideEffects | .AllowCalls;
|
|
flags |= .AllowSideEffects | .AllowCalls;
|
|
|
|
+
|
|
gApp.DebugEvaluate(null, evalStr, val, -1, watch.mLanguage, flags);
|
|
gApp.DebugEvaluate(null, evalStr, val, -1, watch.mLanguage, flags);
|
|
watch.mIsNewExpression = false;
|
|
watch.mIsNewExpression = false;
|
|
}
|
|
}
|
|
@@ -3666,6 +3732,14 @@ namespace IDE.ui
|
|
if (((!valueSubItem.mFailed) && (watch.mHadValue)) || (hadSideEffects) || (hadPropertyEval))
|
|
if (((!valueSubItem.mFailed) && (watch.mHadValue)) || (hadSideEffects) || (hadPropertyEval))
|
|
{
|
|
{
|
|
watch.mHasValue = true;
|
|
watch.mHasValue = true;
|
|
|
|
+
|
|
|
|
+ if ((hadSideEffects) && (watch.AutoRefresh))
|
|
|
|
+ {
|
|
|
|
+ if (watch.mDebuggerStateIdx != gApp.mDebugger.mStateIdx)
|
|
|
|
+ listViewItem.RefreshWatch();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
listViewItem.SetDisabled(true, hadSideEffects);
|
|
listViewItem.SetDisabled(true, hadSideEffects);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -3730,6 +3804,7 @@ namespace IDE.ui
|
|
watch.mIsStackAlloc = false;
|
|
watch.mIsStackAlloc = false;
|
|
watch.mUsedLock = false;
|
|
watch.mUsedLock = false;
|
|
watch.mCurStackIdx = -1;
|
|
watch.mCurStackIdx = -1;
|
|
|
|
+ watch.mDebuggerStateIdx = gApp.mDebugger.mStateIdx;
|
|
watch.mLanguage = .NotSet;
|
|
watch.mLanguage = .NotSet;
|
|
DeleteAndNullify!(watch.mEditInitialize);
|
|
DeleteAndNullify!(watch.mEditInitialize);
|
|
DeleteAndNullify!(watch.mAction);
|
|
DeleteAndNullify!(watch.mAction);
|