1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 15:24:10 +02:00

Debugger fixes

Removing some debugger remote-requests
This commit is contained in:
Brian Fiete 2019-09-20 09:21:29 -07:00
parent c2d086fe8e
commit a32d18d962
21 changed files with 198 additions and 638 deletions

View file

@ -2509,6 +2509,15 @@ namespace IDE
{
scope AutoBeefPerf("IDE.WorkspaceLoaded");
if (!Environment.IsFileSystemCaseSensitive)
{
// Make sure we have the correct actual path
String newPath = new String();
Path.GetActualPathName(mWorkspace.mDir, newPath);
delete mWorkspace.mDir;
mWorkspace.mDir = newPath;
}
List<String> platforms = scope List<String>();
platforms.Add(IDEApp.sPlatform32Name);
platforms.Add(IDEApp.sPlatform64Name);
@ -6052,6 +6061,7 @@ namespace IDE
SourceHash hash = default;
int hashPos = filePath.IndexOf('#');
bool checkForOldFileInfo = false;
if (hashPos != -1)
{
let hashStr = StringView(filePath, hashPos + 1);
@ -6083,20 +6093,28 @@ namespace IDE
if (hashKind == .None)
hashKind = .MD5;
LoadTextFile(filePath, fileText, false, scope [&] () => { hash = SourceHash.Create(hashKind, fileText); }).IgnoreError();
LoadTextFile(filePath, fileText, false, scope [&] () => { fileHash = SourceHash.Create(hashKind, fileText); }).IgnoreError();
if (fileHash != hash)
{
String outFileInfo = scope String();
mDebugger.GetStackFrameOldFileInfo(mDebugger.mActiveCallStackIdx, outFileInfo);
checkForOldFileInfo = true;
}
}
else
{
if (!File.Exists(filePath))
checkForOldFileInfo = true;
}
var args = outFileInfo.Split!('\n');
if (args.Count == 3)
{
filePath.Set(args[0]);
loadCmd = scope:: String(args[1]);
}
}
if (checkForOldFileInfo)
{
String outFileInfo = scope String();
mDebugger.GetStackFrameOldFileInfo(mDebugger.mActiveCallStackIdx, outFileInfo);
var args = outFileInfo.Split!('\n');
if (args.Count == 3)
{
filePath.Set(args[0]);
loadCmd = scope:: String(args[1]);
}
}

View file

@ -1291,8 +1291,19 @@ namespace IDE
if (!mProjectPath.IsEmpty)
{
mProjectDir.Clear();
mProjectPath.Set(path);
IDEUtils.FixFilePath(mProjectPath);
mProjectPath.Clear();
if (!Environment.IsFileSystemCaseSensitive)
{
Path.GetActualPathName(path, mProjectPath);
}
if (mProjectPath.IsEmpty)
{
mProjectPath.Set(path);
IDEUtils.FixFilePath(mProjectPath);
}
Path.GetDirectoryPath(mProjectPath, mProjectDir);
if (structuredData.Load(ProjectFileName) case .Err)
return false;

View file

@ -17,6 +17,7 @@ using IDE.Debugger;
using IDE.Compiler;
using System.Security.Cryptography;
using IDE.util;
using Beefy2D.utils;
namespace IDE.ui
{
@ -94,10 +95,6 @@ namespace IDE.ui
{
if (tabbedView.mIsFillWidget)
gApp.mActiveDocumentsTabbedView = tabbedView;
else
{
NOP!();
}
}
var sourceEditWidgetContent = (SourceEditWidgetContent)mEditWidgetContent;
@ -365,6 +362,7 @@ namespace IDE.ui
public int32 mClassifiedTextVersionId;
public bool mLoadFailed;
String mOldVerLoadCmd ~ delete _;
HTTPRequest mOldVerHTTPRequest ~ delete _;
IDEApp.ExecutionInstance mOldVerLoadExecutionInstance ~ { if (_ != null) _.mAutoDelete = true; };
SourceFindTask mSourceFindTask ~ delete _;
bool mWantsFastClassify;
@ -3141,14 +3139,20 @@ namespace IDE.ui
bool isRepeat = mOldVerLoadCmd != null;
CloseHeader();
mPanelHeader = new PanelHeader();
if (mOldVerLoadCmd == null)
mOldVerLoadCmd = new String(loadCmd);
if (loadCmd.StartsWith("http", .OrdinalIgnoreCase))
{
LoadOldVer();
return;
}
// For testing a long command...
//mOldVerLoadCmd.Set("/bin/sleep.exe 10");
mPanelHeader = new PanelHeader();
String fileName = scope String();
Path.GetFileName(mFilePath, fileName);
String headerStr = scope String();
@ -3191,9 +3195,18 @@ namespace IDE.ui
void LoadOldVer()
{
Debug.Assert(mOldVerLoadExecutionInstance == null);
mOldVerLoadExecutionInstance = gApp.DoRun(null, mOldVerLoadCmd, gApp.mInstallDir, .None);
mOldVerLoadExecutionInstance.mAutoDelete = false;
if (mOldVerLoadCmd.StartsWith("http", .OrdinalIgnoreCase))
{
DeleteAndNullify!(mOldVerHTTPRequest);
mOldVerHTTPRequest = new HTTPRequest();
mOldVerHTTPRequest.GetFile(mOldVerLoadCmd, mFilePath);
}
else
{
Debug.Assert(mOldVerLoadExecutionInstance == null);
mOldVerLoadExecutionInstance = gApp.DoRun(null, mOldVerLoadCmd, gApp.mInstallDir, .None);
mOldVerLoadExecutionInstance.mAutoDelete = false;
}
CloseHeader();
@ -3208,7 +3221,12 @@ namespace IDE.ui
var button = mPanelHeader.AddButton("Cancel");
button.mOnMouseClick.Add(new (evt) =>
{
mOldVerLoadExecutionInstance.Cancel();
if (mOldVerLoadExecutionInstance != null)
mOldVerLoadExecutionInstance.Cancel();
if (mOldVerHTTPRequest != null)
{
DeleteAndNullify!(mOldVerHTTPRequest);
}
});
button = mPanelHeader.AddButton("Always Run");
button.mOnMouseClick.Add(new (evt) =>
@ -5376,6 +5394,15 @@ namespace IDE.ui
}
}
if (mOldVerHTTPRequest != null)
{
let result = mOldVerHTTPRequest.GetResult();
if (result != .NotDone)
{
RetryLoad();
}
}
UpdateMouseover();
var compiler = ResolveCompiler;