mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixes for debugger, -run and -new support for BeefBuild
This commit is contained in:
parent
f534da77ff
commit
eb139fd33c
8 changed files with 98 additions and 64 deletions
|
@ -14,6 +14,7 @@ namespace BeefBuild
|
||||||
int mProgressIdx = 0;
|
int mProgressIdx = 0;
|
||||||
public bool mIsTest;
|
public bool mIsTest;
|
||||||
public bool mIsFailTest;
|
public bool mIsFailTest;
|
||||||
|
public bool mDidRun;
|
||||||
|
|
||||||
/*void Test()
|
/*void Test()
|
||||||
{
|
{
|
||||||
|
@ -40,13 +41,14 @@ namespace BeefBuild
|
||||||
{
|
{
|
||||||
//mConfigName.Clear();
|
//mConfigName.Clear();
|
||||||
//mPlatformName.Clear();
|
//mPlatformName.Clear();
|
||||||
mVerbosity = .Normal;
|
|
||||||
|
|
||||||
//Test();
|
//Test();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
|
if (mVerbosity == .Default)
|
||||||
|
mVerbosity = .Normal;
|
||||||
|
|
||||||
if (mConfigName.IsEmpty)
|
if (mConfigName.IsEmpty)
|
||||||
{
|
{
|
||||||
mConfigName.Set(mIsTest ? "Test" : "Debug");
|
mConfigName.Set(mIsTest ? "Test" : "Debug");
|
||||||
|
@ -98,7 +100,7 @@ namespace BeefBuild
|
||||||
{
|
{
|
||||||
RunTests(false);
|
RunTests(false);
|
||||||
}
|
}
|
||||||
else
|
else if (mVerb != .New)
|
||||||
Compile(.Normal, null);
|
Compile(.Normal, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +110,14 @@ namespace BeefBuild
|
||||||
{
|
{
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
|
case "-new":
|
||||||
|
mVerb = .New;
|
||||||
|
return true;
|
||||||
|
case "-run":
|
||||||
|
if (mVerbosity == .Default)
|
||||||
|
mVerbosity = .Minimal;
|
||||||
|
mVerb = .Run;
|
||||||
|
return true;
|
||||||
case "-test":
|
case "-test":
|
||||||
mIsTest = true;
|
mIsTest = true;
|
||||||
return true;
|
return true;
|
||||||
|
@ -209,7 +219,8 @@ namespace BeefBuild
|
||||||
{
|
{
|
||||||
base.BeefCompileDone();
|
base.BeefCompileDone();
|
||||||
WriteProgress(1.0f);
|
WriteProgress(1.0f);
|
||||||
Console.WriteLine("");
|
if (mVerbosity >= .Normal)
|
||||||
|
Console.WriteLine("");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadFailed()
|
public override void LoadFailed()
|
||||||
|
@ -245,6 +256,25 @@ namespace BeefBuild
|
||||||
|
|
||||||
if ((!IsCompiling) && (!AreTestsRunning()))
|
if ((!IsCompiling) && (!AreTestsRunning()))
|
||||||
{
|
{
|
||||||
|
if ((mVerb == .Run) && (!mDidRun))
|
||||||
|
{
|
||||||
|
let curPath = scope String();
|
||||||
|
Directory.GetCurrentDirectory(curPath);
|
||||||
|
|
||||||
|
let workspaceOptions = gApp.GetCurWorkspaceOptions();
|
||||||
|
let options = gApp.GetCurProjectOptions(mWorkspace.mStartupProject);
|
||||||
|
let targetPaths = scope List<String>();
|
||||||
|
defer ClearAndDeleteItems(targetPaths);
|
||||||
|
this.[Friend]GetTargetPaths(mWorkspace.mStartupProject, workspaceOptions, options, targetPaths);
|
||||||
|
if (targetPaths.IsEmpty)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ExecutionQueueCmd executionCmd = QueueRun(targetPaths[0], "", curPath);
|
||||||
|
executionCmd.mIsTargetRun = true;
|
||||||
|
mDidRun = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Stop();
|
Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ namespace BeefBuild
|
||||||
}
|
}
|
||||||
mApp.Shutdown();
|
mApp.Shutdown();
|
||||||
int32 result = mApp.mFailed ? 1 : 0;
|
int32 result = mApp.mFailed ? 1 : 0;
|
||||||
|
if (mApp.mTargetExitCode != null)
|
||||||
|
result = (int32)mApp.mTargetExitCode.Value;
|
||||||
|
|
||||||
delete mApp;
|
delete mApp;
|
||||||
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
|
|
||||||
namespace System
|
|
||||||
{
|
|
||||||
class Poof
|
|
||||||
{
|
|
||||||
struct Whoop
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct Inner
|
|
||||||
{
|
|
||||||
this()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<void> Test()
|
|
||||||
{
|
|
||||||
return .Ok;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Other<T>
|
|
||||||
{
|
|
||||||
Result<void> Pook()
|
|
||||||
{
|
|
||||||
return .Ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T GetDefault<T>()
|
|
||||||
{
|
|
||||||
return default(T);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
static int32 sCounterVal = 123;
|
|
||||||
}
|
|
|
@ -47,6 +47,7 @@ namespace IDE
|
||||||
|
|
||||||
enum Verbosity
|
enum Verbosity
|
||||||
{
|
{
|
||||||
|
Default,
|
||||||
Quiet,
|
Quiet,
|
||||||
Minimal,
|
Minimal,
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -75,7 +76,8 @@ namespace IDE
|
||||||
Open,
|
Open,
|
||||||
New,
|
New,
|
||||||
OpenOrNew,
|
OpenOrNew,
|
||||||
Test
|
Test,
|
||||||
|
Run
|
||||||
}
|
}
|
||||||
|
|
||||||
enum HotResolveState
|
enum HotResolveState
|
||||||
|
@ -114,7 +116,7 @@ namespace IDE
|
||||||
|
|
||||||
public static bool sExitTest;
|
public static bool sExitTest;
|
||||||
|
|
||||||
public Verbosity mVerbosity = .Detailed;
|
public Verbosity mVerbosity = .Default;
|
||||||
public BeefVerb mVerb;
|
public BeefVerb mVerb;
|
||||||
public bool mDbgCompileDump;
|
public bool mDbgCompileDump;
|
||||||
public int mDbgCompileIdx = -1;
|
public int mDbgCompileIdx = -1;
|
||||||
|
@ -122,6 +124,7 @@ namespace IDE
|
||||||
public String mDbgVersionedCompileDir ~ delete _;
|
public String mDbgVersionedCompileDir ~ delete _;
|
||||||
public DateTime mDbgHighestTime;
|
public DateTime mDbgHighestTime;
|
||||||
public bool mIsFirstRun;
|
public bool mIsFirstRun;
|
||||||
|
public int? mTargetExitCode;
|
||||||
public FileVersionInfo mVersionInfo ~ delete _;
|
public FileVersionInfo mVersionInfo ~ delete _;
|
||||||
|
|
||||||
//public ToolboxPanel mToolboxPanel;
|
//public ToolboxPanel mToolboxPanel;
|
||||||
|
@ -403,7 +406,8 @@ namespace IDE
|
||||||
public String mWorkingDir ~ delete _;
|
public String mWorkingDir ~ delete _;
|
||||||
public Dictionary<String, String> mEnvVars ~ DeleteDictionyAndKeysAndItems!(_);
|
public Dictionary<String, String> mEnvVars ~ DeleteDictionyAndKeysAndItems!(_);
|
||||||
public ArgsFileKind mUseArgsFile;
|
public ArgsFileKind mUseArgsFile;
|
||||||
public int32 mParallelGroup = -1;
|
public int32 mParallelGroup = -1;
|
||||||
|
public bool mIsTargetRun;
|
||||||
}
|
}
|
||||||
public List<ExecutionCmd> mExecutionQueue = new List<ExecutionCmd>() ~ DeleteContainerAndItems!(_);
|
public List<ExecutionCmd> mExecutionQueue = new List<ExecutionCmd>() ~ DeleteContainerAndItems!(_);
|
||||||
|
|
||||||
|
@ -426,6 +430,7 @@ namespace IDE
|
||||||
public int? mExitCode;
|
public int? mExitCode;
|
||||||
public bool mAutoDelete = true;
|
public bool mAutoDelete = true;
|
||||||
public bool mCanceled;
|
public bool mCanceled;
|
||||||
|
public bool mIsTargetRun;
|
||||||
|
|
||||||
public ~this()
|
public ~this()
|
||||||
{
|
{
|
||||||
|
@ -2288,7 +2293,7 @@ namespace IDE
|
||||||
Font.StrEncodePopColor(str);
|
Font.StrEncodePopColor(str);
|
||||||
OutputLine(str);*/
|
OutputLine(str);*/
|
||||||
|
|
||||||
OutputLine("{0}Created new workspace in '{1}'{2}", Font.EncodeColor(0xfffef860), mWorkspace.mDir, Font.EncodePopColor());
|
OutputWarnLine("Created new workspace in '{0}'", mWorkspace.mDir);
|
||||||
if (wantSave)
|
if (wantSave)
|
||||||
{
|
{
|
||||||
SaveWorkspace();
|
SaveWorkspace();
|
||||||
|
@ -2297,7 +2302,7 @@ namespace IDE
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mWorkspace.mNeedsCreate = true;
|
mWorkspace.mNeedsCreate = true;
|
||||||
OutputLine("{0}Use 'File\\Save All' to commit to disk.{1}", Font.EncodeColor(0xfffef860), Font.EncodePopColor());
|
OutputLine("Use 'File\\Save All' to commit to disk.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -6417,6 +6422,21 @@ namespace IDE
|
||||||
OutputLineSmart(errStr, params args);
|
OutputLineSmart(errStr, params args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OutputWarnLine(String format, params Object[] args)
|
||||||
|
{
|
||||||
|
var warnStr = scope String();
|
||||||
|
warnStr.AppendF(format, params args);
|
||||||
|
|
||||||
|
#if CLI
|
||||||
|
var outStr = warnStr;
|
||||||
|
#else
|
||||||
|
var outStr = scope String();
|
||||||
|
outStr.AppendF("{0}{1}{2}", Font.EncodeColor(0xfffef860), warnStr, Font.EncodePopColor());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
OutputLine(outStr);
|
||||||
|
}
|
||||||
|
|
||||||
public void OutputLineSmart(String format, params Object[] args)
|
public void OutputLineSmart(String format, params Object[] args)
|
||||||
{
|
{
|
||||||
String outStr;
|
String outStr;
|
||||||
|
@ -7154,16 +7174,23 @@ namespace IDE
|
||||||
executionInstance.mProcess.Close();
|
executionInstance.mProcess.Close();
|
||||||
|
|
||||||
executionInstance.mStopwatch.Stop();
|
executionInstance.mStopwatch.Stop();
|
||||||
if (executionInstance.mParallelGroup == -1)
|
if (executionInstance.mIsTargetRun)
|
||||||
{
|
{
|
||||||
if (mVerbosity >= .Detailed)
|
mTargetExitCode = executionInstance.mExitCode;
|
||||||
OutputLine("Execution time: {0:0.00}s", executionInstance.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (executionInstance.mParallelGroup == -1)
|
||||||
|
{
|
||||||
|
if (mVerbosity >= .Detailed)
|
||||||
|
OutputLine("Execution time: {0:0.00}s", executionInstance.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||||
|
}
|
||||||
|
|
||||||
if (executionInstance.mCanceled)
|
if (executionInstance.mCanceled)
|
||||||
OutputLine("Execution Canceled");
|
OutputLine("Execution Canceled");
|
||||||
else if (failed)
|
else if (failed)
|
||||||
OutputLine("Execution Failed");
|
OutputLine("Execution Failed");
|
||||||
|
}
|
||||||
|
|
||||||
if (executionInstance.mTempFileName != null)
|
if (executionInstance.mTempFileName != null)
|
||||||
{
|
{
|
||||||
|
@ -7342,6 +7369,7 @@ namespace IDE
|
||||||
var executionQueueCmd = (ExecutionQueueCmd)next;
|
var executionQueueCmd = (ExecutionQueueCmd)next;
|
||||||
var executionInstance = DoRun(executionQueueCmd.mFileName, executionQueueCmd.mArgs, executionQueueCmd.mWorkingDir, executionQueueCmd.mUseArgsFile, executionQueueCmd.mEnvVars);
|
var executionInstance = DoRun(executionQueueCmd.mFileName, executionQueueCmd.mArgs, executionQueueCmd.mWorkingDir, executionQueueCmd.mUseArgsFile, executionQueueCmd.mEnvVars);
|
||||||
executionInstance.mParallelGroup = executionQueueCmd.mParallelGroup;
|
executionInstance.mParallelGroup = executionQueueCmd.mParallelGroup;
|
||||||
|
executionInstance.mIsTargetRun = executionQueueCmd.mIsTargetRun;
|
||||||
}
|
}
|
||||||
else if (next is BuildCompletedCmd)
|
else if (next is BuildCompletedCmd)
|
||||||
{
|
{
|
||||||
|
@ -9686,6 +9714,9 @@ namespace IDE
|
||||||
{
|
{
|
||||||
scope AutoBeefPerf("IDEApp.Init");
|
scope AutoBeefPerf("IDEApp.Init");
|
||||||
|
|
||||||
|
if (mVerbosity == .Default)
|
||||||
|
mVerbosity = .Detailed;
|
||||||
|
|
||||||
mStartedWithTestScript = mRunningTestScript;
|
mStartedWithTestScript = mRunningTestScript;
|
||||||
|
|
||||||
mCommands.Init();
|
mCommands.Init();
|
||||||
|
|
|
@ -5399,7 +5399,11 @@ namespace IDE.ui
|
||||||
let result = mOldVerHTTPRequest.GetResult();
|
let result = mOldVerHTTPRequest.GetResult();
|
||||||
if (result != .NotDone)
|
if (result != .NotDone)
|
||||||
{
|
{
|
||||||
|
if (result == .Failed)
|
||||||
|
gApp.OutputErrorLine("Failed to retrieve source from {}", mOldVerLoadCmd);
|
||||||
|
|
||||||
RetryLoad();
|
RetryLoad();
|
||||||
|
DeleteAndNullify!(mOldVerHTTPRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ String DbgSymRequest::GetPDBStoreDir()
|
||||||
checkPath += GetFileName(mPDBRequested);
|
checkPath += GetFileName(mPDBRequested);
|
||||||
checkPath += "/";
|
checkPath += "/";
|
||||||
checkPath += GetGuidString();
|
checkPath += GetGuidString();
|
||||||
checkPath += StrFormat("%X/", mWantAge);
|
checkPath += StrFormat("%x/", mWantAge);
|
||||||
return checkPath;
|
return checkPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ NetRequest::~NetRequest()
|
||||||
mResult->mCurRequest = NULL;
|
mResult->mCurRequest = NULL;
|
||||||
if (mResult->mDoneEvent != NULL)
|
if (mResult->mDoneEvent != NULL)
|
||||||
{
|
{
|
||||||
mResult->mDoneEvent->Set();
|
mResult->mDoneEvent->Set(true);
|
||||||
BF_ASSERT(!mResult->mRemoved);
|
BF_ASSERT(!mResult->mRemoved);
|
||||||
}
|
}
|
||||||
if (mResult->mRemoved)
|
if (mResult->mRemoved)
|
||||||
|
|
|
@ -1431,8 +1431,18 @@ bool WinDebugger::DoUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsMiniDumpDebugger())
|
if (IsMiniDumpDebugger())
|
||||||
{
|
{
|
||||||
Sleep(20);
|
//
|
||||||
|
{
|
||||||
|
AutoCrit autoCrit(mDebugManager->mCritSect);
|
||||||
|
if (mRunState == RunState_Terminating)
|
||||||
|
{
|
||||||
|
mRunState = RunState_Terminated;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep(20);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue