mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-12 13:24:09 +02:00
Added !raw immediate window command for string dumps
This commit is contained in:
parent
66adc12f73
commit
0f014cbec8
6 changed files with 61 additions and 6 deletions
|
@ -96,7 +96,8 @@ namespace IDE.Debugger
|
||||||
MemoryAddress = 0x40,
|
MemoryAddress = 0x40,
|
||||||
MemoryWatch = 0x80,
|
MemoryWatch = 0x80,
|
||||||
Symbol = 0x100,
|
Symbol = 0x100,
|
||||||
StepIntoCall = 0x200
|
StepIntoCall = 0x200,
|
||||||
|
RawStr = 0x400,
|
||||||
}
|
}
|
||||||
|
|
||||||
[Reflect]
|
[Reflect]
|
||||||
|
|
|
@ -718,6 +718,14 @@ namespace IDE.ui
|
||||||
var watch = useListViewItem.mWatchEntry;
|
var watch = useListViewItem.mWatchEntry;
|
||||||
String.NewOrSet!(watch.mName, displayString);
|
String.NewOrSet!(watch.mName, displayString);
|
||||||
String.NewOrSet!(watch.mEvalStr, evalString);
|
String.NewOrSet!(watch.mEvalStr, evalString);
|
||||||
|
|
||||||
|
if (watch.mEvalStr.StartsWith("!raw"))
|
||||||
|
{
|
||||||
|
for (int i < 4)
|
||||||
|
watch.mEvalStr[i] = ' ';
|
||||||
|
watch.mResultType = .RawText;
|
||||||
|
}
|
||||||
|
|
||||||
useListViewItem.mWatchEntry = watch;
|
useListViewItem.mWatchEntry = watch;
|
||||||
if (!isLiteral)
|
if (!isLiteral)
|
||||||
useListViewItem.Label = displayString;
|
useListViewItem.Label = displayString;
|
||||||
|
@ -759,11 +767,13 @@ namespace IDE.ui
|
||||||
flags |= .AllowSideEffects | .AllowCalls;
|
flags |= .AllowSideEffects | .AllowCalls;
|
||||||
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluateProperties)
|
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluateProperties)
|
||||||
flags |= .AllowProperties;
|
flags |= .AllowProperties;
|
||||||
|
if (watch.mResultType == .RawText)
|
||||||
|
flags |= .RawStr;
|
||||||
|
|
||||||
DebugManager.Language language = mLanguage;
|
DebugManager.Language language = mLanguage;
|
||||||
if (parentWatchEntry != null)
|
if (parentWatchEntry != null)
|
||||||
language = parentWatchEntry.mLanguage;
|
language = parentWatchEntry.mLanguage;
|
||||||
gApp.DebugEvaluate(null, evalString, val, -1, language, flags);
|
gApp.DebugEvaluate(null, watch.mEvalStr, val, -1, language, flags);
|
||||||
}
|
}
|
||||||
if (val == "!pending")
|
if (val == "!pending")
|
||||||
{
|
{
|
||||||
|
@ -773,6 +783,13 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
watch.mIsPending = false;
|
watch.mIsPending = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (watch.mResultType == .RawText)
|
||||||
|
{
|
||||||
|
String.NewOrSet!(valueSubItem.mLabel, val);
|
||||||
|
return useListViewItem;
|
||||||
|
}
|
||||||
|
|
||||||
var vals = scope List<StringView>(val.Split('\n'));
|
var vals = scope List<StringView>(val.Split('\n'));
|
||||||
|
|
||||||
//if (!vals[0].IsEmpty)
|
//if (!vals[0].IsEmpty)
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Beefy.theme.dark;
|
||||||
using Beefy.gfx;
|
using Beefy.gfx;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using IDE.Debugger;
|
||||||
|
|
||||||
namespace IDE.ui
|
namespace IDE.ui
|
||||||
{
|
{
|
||||||
|
@ -379,7 +380,11 @@ namespace IDE.ui
|
||||||
var subItemLabel = result.GetSubItem(1).mLabel;
|
var subItemLabel = result.GetSubItem(1).mLabel;
|
||||||
if (subItemLabel == null)
|
if (subItemLabel == null)
|
||||||
subItemLabel = "";
|
subItemLabel = "";
|
||||||
mEditWidgetContent.AppendText(scope String(" ", subItemLabel, "\n"));
|
|
||||||
|
if (result.mWatchEntry.mResultType == .RawText)
|
||||||
|
mEditWidgetContent.AppendText(scope String(subItemLabel, "\n"));
|
||||||
|
else
|
||||||
|
mEditWidgetContent.AppendText(scope String(" ", subItemLabel, "\n"));
|
||||||
|
|
||||||
if (result.mWatchEntry.mWarnings != null)
|
if (result.mWatchEntry.mWarnings != null)
|
||||||
{
|
{
|
||||||
|
@ -415,7 +420,11 @@ namespace IDE.ui
|
||||||
for (int32 i = startPos; i < mEditWidgetContent.mData.mTextLength; i++)
|
for (int32 i = startPos; i < mEditWidgetContent.mData.mTextLength; i++)
|
||||||
mEditWidgetContent.mData.mText[i].mDisplayTypeId = (uint8)SourceElementType.Error;
|
mEditWidgetContent.mData.mText[i].mDisplayTypeId = (uint8)SourceElementType.Error;
|
||||||
}
|
}
|
||||||
else
|
else if (result.mWatchEntry.mResultType == .RawText)
|
||||||
|
{
|
||||||
|
// No info button
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
mInfoButton.Resize(resultX - GS!(3), resultY - GS!(2), GS!(20), GS!(20));
|
mInfoButton.Resize(resultX - GS!(3), resultY - GS!(2), GS!(20), GS!(20));
|
||||||
mEditWidgetContent.AddWidget(mInfoButton);
|
mEditWidgetContent.AddWidget(mInfoButton);
|
||||||
|
@ -547,7 +556,16 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gApp.DebugEvaluate(null, cmdText, val, mEditWidgetContent.CursorTextPos - mEntryStartPos.mIndex - 2);
|
DebugManager.EvalExpressionFlags flags = .None;
|
||||||
|
|
||||||
|
if (cmdText.StartsWith("!raw"))
|
||||||
|
{
|
||||||
|
for (int i < 4)
|
||||||
|
cmdText[i] = ' ';
|
||||||
|
flags |= .RawStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
gApp.DebugEvaluate(null, cmdText, val, mEditWidgetContent.CursorTextPos - mEntryStartPos.mIndex - 2, .NotSet, flags);
|
||||||
gApp.mIsImmediateDebugExprEval = true;
|
gApp.mIsImmediateDebugExprEval = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -570,7 +588,19 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
var info = scope String()..Append(val, idx + ":autocomplete\n".Length);
|
var info = scope String()..Append(val, idx + ":autocomplete\n".Length);
|
||||||
if (!editWidgetContent.mAutoComplete.mIsDocumentationPass)
|
if (!editWidgetContent.mAutoComplete.mIsDocumentationPass)
|
||||||
|
{
|
||||||
|
if ((cmdText.StartsWith("!")) && (!cmdText.Contains(' ')))
|
||||||
|
{
|
||||||
|
if ("!raw".Contains(cmdText))
|
||||||
|
info.Append("cmd\traw\n");
|
||||||
|
if ("!info".Contains(cmdText))
|
||||||
|
info.Append("cmd\tinfo\n");
|
||||||
|
if ("!step".Contains(cmdText))
|
||||||
|
info.Append("cmd\tstep\n");
|
||||||
|
}
|
||||||
|
|
||||||
editWidgetContent.mAutoComplete.SetInfo(info, true, mEntryStartPos.mIndex + 1);
|
editWidgetContent.mAutoComplete.SetInfo(info, true, mEntryStartPos.mIndex + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (editWidgetContent.mAutoComplete != null)
|
else if (editWidgetContent.mAutoComplete != null)
|
||||||
editWidgetContent.mAutoComplete.Close();
|
editWidgetContent.mAutoComplete.Close();
|
||||||
|
|
|
@ -27,7 +27,8 @@ namespace IDE.ui
|
||||||
TypeClass = 0x80,
|
TypeClass = 0x80,
|
||||||
TypeValueType = 0x100,
|
TypeValueType = 0x100,
|
||||||
Namespace = 0x200,
|
Namespace = 0x200,
|
||||||
Text = 0x400
|
Text = 0x400,
|
||||||
|
RawText = 0x800
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WatchEntry
|
public class WatchEntry
|
||||||
|
|
|
@ -120,6 +120,7 @@ enum DwEvalExpressionFlags : int16
|
||||||
DwEvalExpressionFlag_MemoryWatch = 0x80,
|
DwEvalExpressionFlag_MemoryWatch = 0x80,
|
||||||
DwEvalExpressionFlag_Symbol = 0x100,
|
DwEvalExpressionFlag_Symbol = 0x100,
|
||||||
DwEvalExpressionFlag_StepIntoCalls = 0x200,
|
DwEvalExpressionFlag_StepIntoCalls = 0x200,
|
||||||
|
DwEvalExpressionFlag_RawStr = 0x400
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DwDisplayInfo
|
struct DwDisplayInfo
|
||||||
|
|
|
@ -9504,6 +9504,11 @@ String WinDebugger::Evaluate(const StringImpl& expr, DwFormatInfo formatInfo, in
|
||||||
expressionFlags = (DwEvalExpressionFlags)(expressionFlags & ~DwEvalExpressionFlag_AllowCalls);
|
expressionFlags = (DwEvalExpressionFlags)(expressionFlags & ~DwEvalExpressionFlag_AllowCalls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((expressionFlags & DwEvalExpressionFlag_RawStr) != 0)
|
||||||
|
{
|
||||||
|
formatInfo.mRawString = true;
|
||||||
|
}
|
||||||
|
|
||||||
auto dbgModule = GetCallStackDbgModule(callStackIdx);
|
auto dbgModule = GetCallStackDbgModule(callStackIdx);
|
||||||
auto dbgSubprogram = GetCallStackSubprogram(callStackIdx);
|
auto dbgSubprogram = GetCallStackSubprogram(callStackIdx);
|
||||||
DbgCompileUnit* dbgCompileUnit = NULL;
|
DbgCompileUnit* dbgCompileUnit = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue