1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 03:28:02 +02:00

Embedded console / terminal support

This commit is contained in:
Brian Fiete 2024-07-23 07:56:23 +02:00
parent 60817eec48
commit 20a8e3327c
28 changed files with 2317 additions and 690 deletions

View file

@ -138,6 +138,14 @@ namespace IDE.Debugger
Allocations = 2
}
public enum OpenFileFlags
{
None,
RedirectStdInput = 1,
RedirectStdOutput = 2,
RedirectStdError = 4
}
public List<Breakpoint> mBreakpointList = new List<Breakpoint>();
public Dictionary<String, StepFilter> mStepFilterList = new Dictionary<String, StepFilter>();
@ -157,7 +165,7 @@ namespace IDE.Debugger
static extern bool Debugger_OpenMiniDump(char8* filename);
[CallingConvention(.Stdcall),CLink]
static extern bool Debugger_OpenFile(char8* launchPath, char8* targetPath, char8* args, char8* workingDir, void* envBlockPtr, int32 envBlockLen, bool hotSwapEnabled);
static extern bool Debugger_OpenFile(char8* launchPath, char8* targetPath, char8* args, char8* workingDir, void* envBlockPtr, int32 envBlockLen, bool hotSwapEnabled, OpenFileFlags openFileFlags);
[CallingConvention(.Stdcall),CLink]
static extern bool Debugger_ComptimeAttach(void* bfCompiler);
@ -165,6 +173,9 @@ namespace IDE.Debugger
[CallingConvention(.Stdcall),CLink]
static extern bool Debugger_Attach(int32 processId, AttachFlags attachFlags);
[CallingConvention(.Stdcall),CLink]
public static extern void Debugger_GetStdHandles(Platform.BfpFile** outStdIn, Platform.BfpFile** outStdOut, Platform.BfpFile** outStdErr);
[CallingConvention(.Stdcall),CLink]
static extern void Debugger_Run();
@ -473,7 +484,7 @@ namespace IDE.Debugger
Debugger_FullReportMemory();
}
public bool OpenFile(String launchPath, String targetPath, String args, String workingDir, Span<char8> envBlock, bool isCompiled, bool hotSwapEnabled)
public bool OpenFile(String launchPath, String targetPath, String args, String workingDir, Span<char8> envBlock, bool isCompiled, bool hotSwapEnabled, OpenFileFlags openFileFlags)
{
DeleteAndNullify!(mRunningPath);
mRunningPath = new String(launchPath);
@ -481,7 +492,7 @@ namespace IDE.Debugger
mIsComptimeDebug = false;
mIsRunningCompiled = isCompiled;
mIsRunningWithHotSwap = hotSwapEnabled;
return Debugger_OpenFile(launchPath, targetPath, args, workingDir, envBlock.Ptr, (int32)envBlock.Length, hotSwapEnabled);
return Debugger_OpenFile(launchPath, targetPath, args, workingDir, envBlock.Ptr, (int32)envBlock.Length, hotSwapEnabled, openFileFlags);
}
public bool ComptimeAttach(BfCompiler compiler)
@ -1175,6 +1186,11 @@ namespace IDE.Debugger
return Debugger_Attach(process.Id, attachFlags);
}
public void GetStdHandles(Platform.BfpFile** outStdIn, Platform.BfpFile** outStdOut, Platform.BfpFile** outStdErr)
{
Debugger_GetStdHandles(outStdIn, outStdOut, outStdErr);
}
public DbgProfiler StartProfiling(int threadId, String desc, int sampleRate)
{
DbgProfiler profiler = new DbgProfiler(Debugger_StartProfiling(threadId, desc, (.)sampleRate));