mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Added @Script: support to breakpoints
This commit is contained in:
parent
2d8bf1b11b
commit
2a2913f857
4 changed files with 83 additions and 18 deletions
|
@ -13690,6 +13690,19 @@ namespace IDE
|
|||
{
|
||||
mSymSrvStatus.Set(param);
|
||||
}
|
||||
else if (cmd == "script")
|
||||
{
|
||||
String absTestPath = scope String();
|
||||
if (mWorkspace.mDir != null)
|
||||
Path.GetAbsolutePath(param, mWorkspace.mDir, absTestPath);
|
||||
else
|
||||
Path.GetFullPath(param, absTestPath);
|
||||
if (mScriptManager.mFailed)
|
||||
mScriptManager.Clear();
|
||||
mScriptManager.mSoftFail = true;
|
||||
mScriptManager.SetTimeoutMS(20*60*1000); // 20 minute timeout
|
||||
mScriptManager.QueueCommandFile(absTestPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Runtime.FatalError("Invalid debugger message type");
|
||||
|
|
|
@ -1562,6 +1562,15 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void PrintEval(String evalStr)
|
||||
{
|
||||
String outVal = scope String();
|
||||
if (!Evaluate(evalStr, outVal))
|
||||
return;
|
||||
gApp.OutputLineSmart(outVal);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void AssertTypeInfo(int compilerId, String typeName, String wantTypeInfo)
|
||||
{
|
||||
|
@ -1729,7 +1738,29 @@ namespace IDE
|
|||
}
|
||||
|
||||
[IDECommand]
|
||||
public void SelectCallStackWithStr(String str)
|
||||
public void PrintCallStack()
|
||||
{
|
||||
gApp.OutputLine("Callstack:");
|
||||
int32 stackIdx = 0;
|
||||
while (true)
|
||||
{
|
||||
int stackCount = gApp.mDebugger.GetCallStackCount();
|
||||
if (stackIdx >= stackCount)
|
||||
{
|
||||
gApp.mDebugger.UpdateCallStack();
|
||||
if (stackIdx >= gApp.mDebugger.GetCallStackCount())
|
||||
break;
|
||||
}
|
||||
|
||||
String file = scope .();
|
||||
String stackFrameInfo = scope .();
|
||||
gApp.mDebugger.GetStackFrameInfo(stackIdx, var addr, file, stackFrameInfo);
|
||||
gApp.OutputLine(scope $" {stackIdx}: {stackFrameInfo}");
|
||||
stackIdx++;
|
||||
}
|
||||
}
|
||||
|
||||
public bool DoSelectCallStackWithStr(String str)
|
||||
{
|
||||
int32 stackIdx = 0;
|
||||
while (true)
|
||||
|
@ -1748,12 +1779,24 @@ namespace IDE
|
|||
if (stackFrameInfo.Contains(str))
|
||||
{
|
||||
gApp.mDebugger.mActiveCallStackIdx = (.)stackIdx;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
stackIdx++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
mScriptManager.Fail("Failed to find stack frame containing string '{}'", str);
|
||||
[IDECommand]
|
||||
public void SelectCallStackWithStr(String str)
|
||||
{
|
||||
if (!DoSelectCallStackWithStr(str))
|
||||
mScriptManager.Fail("Failed to find stack frame containing string '{}'", str);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void TrySelectCallStackWithStr(String str)
|
||||
{
|
||||
DoSelectCallStackWithStr(str);
|
||||
}
|
||||
|
||||
public bool AssertRunning()
|
||||
|
|
|
@ -2859,7 +2859,7 @@ namespace IDE.ui
|
|||
|
||||
base.UpdateAll();
|
||||
if (mWantRemoveSelf)
|
||||
mParentItem.RemoveChildItem(this);
|
||||
mParentItem?.RemoveChildItem(this);
|
||||
|
||||
if (mColumnIdx == 0)
|
||||
{
|
||||
|
|
|
@ -4092,22 +4092,31 @@ bool WinDebugger::CheckConditionalBreakpoint(WdBreakpoint* breakpoint, DbgSubpro
|
|||
|
||||
String expr;
|
||||
_SplitExpr(headBreakpoint->mLogging, expr, formatInfo.mSubjectExpr);
|
||||
if (expr.StartsWith("@Beef:"))
|
||||
{
|
||||
expr.Remove(0, 6);
|
||||
formatInfo.mLanguage = DbgLanguage_Beef;
|
||||
}
|
||||
else if (expr.StartsWith("@C:"))
|
||||
{
|
||||
expr.Remove(0, 3);
|
||||
formatInfo.mLanguage = DbgLanguage_C;
|
||||
}
|
||||
|
||||
ProcessEvalString(dbgCompileUnit, DbgTypedValue(), expr, displayString, formatInfo, NULL, false);
|
||||
mRunState = prevRunState;
|
||||
if (expr.StartsWith("@Script:"))
|
||||
{
|
||||
displayString = "script ";
|
||||
displayString += expr.Substring(8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (expr.StartsWith("@Beef:"))
|
||||
{
|
||||
expr.Remove(0, 6);
|
||||
formatInfo.mLanguage = DbgLanguage_Beef;
|
||||
}
|
||||
else if (expr.StartsWith("@C:"))
|
||||
{
|
||||
expr.Remove(0, 3);
|
||||
formatInfo.mLanguage = DbgLanguage_C;
|
||||
}
|
||||
|
||||
displayString.Insert(0, "log ");
|
||||
displayString.Append("\n");
|
||||
ProcessEvalString(dbgCompileUnit, DbgTypedValue(), expr, displayString, formatInfo, NULL, false);
|
||||
mRunState = prevRunState;
|
||||
|
||||
displayString.Insert(0, "log ");
|
||||
displayString.Append("\n");
|
||||
}
|
||||
|
||||
mDebugManager->mOutMessages.push_back(displayString);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue