mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +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;
|
||||
public bool mIsTest;
|
||||
public bool mIsFailTest;
|
||||
public bool mDidRun;
|
||||
|
||||
/*void Test()
|
||||
{
|
||||
|
@ -40,13 +41,14 @@ namespace BeefBuild
|
|||
{
|
||||
//mConfigName.Clear();
|
||||
//mPlatformName.Clear();
|
||||
mVerbosity = .Normal;
|
||||
|
||||
//Test();
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
if (mVerbosity == .Default)
|
||||
mVerbosity = .Normal;
|
||||
|
||||
if (mConfigName.IsEmpty)
|
||||
{
|
||||
mConfigName.Set(mIsTest ? "Test" : "Debug");
|
||||
|
@ -98,7 +100,7 @@ namespace BeefBuild
|
|||
{
|
||||
RunTests(false);
|
||||
}
|
||||
else
|
||||
else if (mVerb != .New)
|
||||
Compile(.Normal, null);
|
||||
}
|
||||
|
||||
|
@ -108,6 +110,14 @@ namespace BeefBuild
|
|||
{
|
||||
switch (key)
|
||||
{
|
||||
case "-new":
|
||||
mVerb = .New;
|
||||
return true;
|
||||
case "-run":
|
||||
if (mVerbosity == .Default)
|
||||
mVerbosity = .Minimal;
|
||||
mVerb = .Run;
|
||||
return true;
|
||||
case "-test":
|
||||
mIsTest = true;
|
||||
return true;
|
||||
|
@ -209,7 +219,8 @@ namespace BeefBuild
|
|||
{
|
||||
base.BeefCompileDone();
|
||||
WriteProgress(1.0f);
|
||||
Console.WriteLine("");
|
||||
if (mVerbosity >= .Normal)
|
||||
Console.WriteLine("");
|
||||
}
|
||||
|
||||
public override void LoadFailed()
|
||||
|
@ -245,6 +256,25 @@ namespace BeefBuild
|
|||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ namespace BeefBuild
|
|||
}
|
||||
mApp.Shutdown();
|
||||
int32 result = mApp.mFailed ? 1 : 0;
|
||||
if (mApp.mTargetExitCode != null)
|
||||
result = (int32)mApp.mTargetExitCode.Value;
|
||||
|
||||
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
|
||||
{
|
||||
Default,
|
||||
Quiet,
|
||||
Minimal,
|
||||
Normal,
|
||||
|
@ -75,7 +76,8 @@ namespace IDE
|
|||
Open,
|
||||
New,
|
||||
OpenOrNew,
|
||||
Test
|
||||
Test,
|
||||
Run
|
||||
}
|
||||
|
||||
enum HotResolveState
|
||||
|
@ -114,7 +116,7 @@ namespace IDE
|
|||
|
||||
public static bool sExitTest;
|
||||
|
||||
public Verbosity mVerbosity = .Detailed;
|
||||
public Verbosity mVerbosity = .Default;
|
||||
public BeefVerb mVerb;
|
||||
public bool mDbgCompileDump;
|
||||
public int mDbgCompileIdx = -1;
|
||||
|
@ -122,6 +124,7 @@ namespace IDE
|
|||
public String mDbgVersionedCompileDir ~ delete _;
|
||||
public DateTime mDbgHighestTime;
|
||||
public bool mIsFirstRun;
|
||||
public int? mTargetExitCode;
|
||||
public FileVersionInfo mVersionInfo ~ delete _;
|
||||
|
||||
//public ToolboxPanel mToolboxPanel;
|
||||
|
@ -404,6 +407,7 @@ namespace IDE
|
|||
public Dictionary<String, String> mEnvVars ~ DeleteDictionyAndKeysAndItems!(_);
|
||||
public ArgsFileKind mUseArgsFile;
|
||||
public int32 mParallelGroup = -1;
|
||||
public bool mIsTargetRun;
|
||||
}
|
||||
public List<ExecutionCmd> mExecutionQueue = new List<ExecutionCmd>() ~ DeleteContainerAndItems!(_);
|
||||
|
||||
|
@ -426,6 +430,7 @@ namespace IDE
|
|||
public int? mExitCode;
|
||||
public bool mAutoDelete = true;
|
||||
public bool mCanceled;
|
||||
public bool mIsTargetRun;
|
||||
|
||||
public ~this()
|
||||
{
|
||||
|
@ -2288,7 +2293,7 @@ namespace IDE
|
|||
Font.StrEncodePopColor(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)
|
||||
{
|
||||
SaveWorkspace();
|
||||
|
@ -2297,7 +2302,7 @@ namespace IDE
|
|||
else
|
||||
{
|
||||
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
|
||||
|
@ -6417,6 +6422,21 @@ namespace IDE
|
|||
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)
|
||||
{
|
||||
String outStr;
|
||||
|
@ -7154,16 +7174,23 @@ namespace IDE
|
|||
executionInstance.mProcess.Close();
|
||||
|
||||
executionInstance.mStopwatch.Stop();
|
||||
if (executionInstance.mParallelGroup == -1)
|
||||
{
|
||||
if (mVerbosity >= .Detailed)
|
||||
OutputLine("Execution time: {0:0.00}s", executionInstance.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
if (executionInstance.mIsTargetRun)
|
||||
{
|
||||
mTargetExitCode = executionInstance.mExitCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (executionInstance.mParallelGroup == -1)
|
||||
{
|
||||
if (mVerbosity >= .Detailed)
|
||||
OutputLine("Execution time: {0:0.00}s", executionInstance.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
}
|
||||
|
||||
if (executionInstance.mCanceled)
|
||||
OutputLine("Execution Canceled");
|
||||
else if (failed)
|
||||
OutputLine("Execution Failed");
|
||||
if (executionInstance.mCanceled)
|
||||
OutputLine("Execution Canceled");
|
||||
else if (failed)
|
||||
OutputLine("Execution Failed");
|
||||
}
|
||||
|
||||
if (executionInstance.mTempFileName != null)
|
||||
{
|
||||
|
@ -7342,6 +7369,7 @@ namespace IDE
|
|||
var executionQueueCmd = (ExecutionQueueCmd)next;
|
||||
var executionInstance = DoRun(executionQueueCmd.mFileName, executionQueueCmd.mArgs, executionQueueCmd.mWorkingDir, executionQueueCmd.mUseArgsFile, executionQueueCmd.mEnvVars);
|
||||
executionInstance.mParallelGroup = executionQueueCmd.mParallelGroup;
|
||||
executionInstance.mIsTargetRun = executionQueueCmd.mIsTargetRun;
|
||||
}
|
||||
else if (next is BuildCompletedCmd)
|
||||
{
|
||||
|
@ -9686,6 +9714,9 @@ namespace IDE
|
|||
{
|
||||
scope AutoBeefPerf("IDEApp.Init");
|
||||
|
||||
if (mVerbosity == .Default)
|
||||
mVerbosity = .Detailed;
|
||||
|
||||
mStartedWithTestScript = mRunningTestScript;
|
||||
|
||||
mCommands.Init();
|
||||
|
|
|
@ -5399,7 +5399,11 @@ namespace IDE.ui
|
|||
let result = mOldVerHTTPRequest.GetResult();
|
||||
if (result != .NotDone)
|
||||
{
|
||||
if (result == .Failed)
|
||||
gApp.OutputErrorLine("Failed to retrieve source from {}", mOldVerLoadCmd);
|
||||
|
||||
RetryLoad();
|
||||
DeleteAndNullify!(mOldVerHTTPRequest);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ String DbgSymRequest::GetPDBStoreDir()
|
|||
checkPath += GetFileName(mPDBRequested);
|
||||
checkPath += "/";
|
||||
checkPath += GetGuidString();
|
||||
checkPath += StrFormat("%X/", mWantAge);
|
||||
checkPath += StrFormat("%x/", mWantAge);
|
||||
return checkPath;
|
||||
}
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ NetRequest::~NetRequest()
|
|||
mResult->mCurRequest = NULL;
|
||||
if (mResult->mDoneEvent != NULL)
|
||||
{
|
||||
mResult->mDoneEvent->Set();
|
||||
mResult->mDoneEvent->Set(true);
|
||||
BF_ASSERT(!mResult->mRemoved);
|
||||
}
|
||||
if (mResult->mRemoved)
|
||||
|
|
|
@ -1432,6 +1432,16 @@ bool WinDebugger::DoUpdate()
|
|||
|
||||
if (IsMiniDumpDebugger())
|
||||
{
|
||||
//
|
||||
{
|
||||
AutoCrit autoCrit(mDebugManager->mCritSect);
|
||||
if (mRunState == RunState_Terminating)
|
||||
{
|
||||
mRunState = RunState_Terminated;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Sleep(20);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue