1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 14:54:09 +02:00

Added @Script: support to breakpoints

This commit is contained in:
Brian Fiete 2024-08-25 09:30:49 -04:00
parent 2d8bf1b11b
commit 2a2913f857
4 changed files with 83 additions and 18 deletions

View file

@ -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()