1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00

Win32 debugging fixes, more work on custom compile commands

Fixed working dir for 'launch'
Fixed attaching to process - stack trace wasn't updating properly
Fixed more custom compile stuff, and BeefySysLib bin destination
Fixed linking issues related to Bfp* and Bp* exports in both BeefRT and BeefySysLib
Fixed a crash with conditional breakpoints
Fixed release mode IDE issues (related to hot swap breakpoints)
Fixed hotswapping type data with LLVM builds
Fixed 'Pause' state processing Running_ToTempBreakpoint for ScriptManager
Fixed Win32 step out when there's an ESP adjustment at the return site
Made step-out skip over "unimportant" instructions at return site
This commit is contained in:
Brian Fiete 2019-08-29 14:19:07 -07:00
parent 09016c8dc0
commit a367b8165f
60 changed files with 1131 additions and 1065 deletions

View file

@ -25,9 +25,9 @@ OptimizationLevel = "O0"
[Configs.Debug.Win64]
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
CLibType = "Dynamic"
DebugCommandArguments = "-open=c:\\proj\\TestCPP\\TestCPP.bfdbg"
DebugCommandArguments = "-proddir=C:\\Beef\\IDE\\Tests\\Test1 -test=scripts\\HotSwap_VirtualRemap.txt -platform=Win64 -testNoExit"
DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
@ -41,7 +41,7 @@ TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE"
OtherLinkFlags = "Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib Beef042RT64.lib IDEHelper64.lib BeefySysLib64.lib"
CLibType = "Dynamic"
DebugCommandArguments = "-proddir=\\Beef\\IDE\\Tests\\Rando -test=\\Beef\\IDE\\Tests\\scripts\\DebugAndExit.txt -testNoExit"
DebugCommandArguments = "-proddir=C:\\Beef\\IDE\\Tests\\Test1 -test=scripts\\HotSwap_BaseChange.txt -testNoExit"
DebugWorkingDirectory = "$(ProjectDir)\\dist"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]

View file

@ -1,484 +0,0 @@
FileVersion = 1
LastConfig = "Debug"
LastPlatform = "Win64"
RecentFilesList = ["c:\\beef\\ide\\src\\IDEApp.bf", "c:\\beef\\IDEHelper\\DebugManager.cpp", "c:\\beef\\IDEHelper\\Compiler\\BfModule.cpp", "c:\\beef\\IDEHelper\\Compiler\\BfCompiler.cpp", "c:\\beef\\ide\\src\\BuildContext.bf", "c:\\beef\\beefrt\\dbg\\gc.cpp", "c:\\beef\\ide\\src\\ScriptManager.bf", "c:\\beef\\ide\\src\\Project.bf", "c:\\beef\\ide\\src\\CommandQueueManager.bf", "c:\\Beef\\BeefLibs\\corlib\\src\\System\\String.bf"]
StepFilters = ["System.StringView.operator System.StringView"]
[MainWindow]
X = 1021
Y = 227
Width = 2206
Height = 1810
[MainDockingFrame]
Type = "DockingFrame"
SplitType = 2
[[MainDockingFrame.DockedWidgets]]
RequestedWidth = 350.0
RequestedHeight = 200.0
SizePriority = 200.0
Type = "DockingFrame"
SplitType = 1
[[MainDockingFrame.DockedWidgets.DockedWidgets]]
RequestedWidth = 200.0
RequestedHeight = 200.0
Type = "TabbedView"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
Active = true
TabLabel = "Workspace"
TabWidth = 115.0
Type = "ProjectPanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets]]
IsFillWidget = true
Permanent = true
RequestedWidth = 150.0
RequestedHeight = 150.0
SizePriority = 150.0
DefaultDocumentsTabbedView = true
Type = "TabbedView"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "DebugManager.cpp"
TabWidth = 156.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\DebugManager.cpp"
CursorPos = 15042
VertPos = 8490.0
ProjectName = "IDEHelper"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "CommandQueueManager.bf"
TabWidth = 205.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\CommandQueueManager.bf"
CursorPos = 896
VertPos = 1170.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ProjectProperties.bf"
TabWidth = 145.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\ProjectProperties.bf"
CursorPos = 1930
VertPos = 270.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ProjectPanel.bf"
TabWidth = 116.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\ProjectPanel.bf"
CursorPos = 58964
VertPos = 25350.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Directory.bf"
TabWidth = 98.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\IO\\Directory.bf"
CursorPos = 294
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "AutoComplete.bf"
TabWidth = 128.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\AutoComplete.bf"
CursorPos = 5948
VertPos = 3060.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Stopwatch.bf"
TabWidth = 105.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Diagnostics\\Stopwatch.bf"
CursorPos = 309
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "IComparable.bf"
TabWidth = 120.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\IComparable.bf"
CursorPos = 404
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Dictionary.bf"
TabWidth = 103.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Collections\\Generic\\Dictionary.bf"
CursorPos = 13141
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Workspace.bf"
TabWidth = 110.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\Workspace.bf"
CursorPos = 10820
VertPos = 5745.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Project.bf"
TabWidth = 85.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\Project.bf"
CursorPos = 31286
VertPos = 16875.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "gc.cpp"
TabWidth = 69.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\beefrt\\dbg\\gc.cpp"
CursorPos = 29571
VertPos = 16845.0
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "String.bf"
TabWidth = 79.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\String.bf"
CursorPos = 20322
VertPos = 11775.0
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ImmediatePanel.bf"
TabWidth = 137.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\ImmediatePanel.bf"
CursorPos = 1248
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "StatusBar.bf"
TabWidth = 98.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\StatusBar.bf"
CursorPos = 11876
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ImmediateWidget.bf"
TabWidth = 148.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\ImmediateWidget.bf"
CursorPos = 10575
VertPos = 4425.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ScriptManager.bf"
TabWidth = 130.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ScriptManager.bf"
CursorPos = 46372
VertPos = 29080.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ListView.bf"
TabWidth = 91.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\BeefLibs\\Beefy2D\\src\\widgets\\ListView.bf"
CursorPos = 24610
ProjectName = "Beefy2D"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "EditWidget.bf"
TabWidth = 109.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\BeefLibs\\Beefy2D\\src\\widgets\\EditWidget.bf"
CursorPos = 70859
ProjectName = "Beefy2D"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "OpenFileInSolutionDialog.bf"
TabWidth = 191.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\OpenFileInSolutionDialog.bf"
CursorPos = 3378
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "InstalledProjectDialog.bf"
TabWidth = 171.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\InstalledProjectDialog.bf"
CursorPos = 2662
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "ClassViewPanel.bf"
TabWidth = 133.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\ClassViewPanel.bf"
CursorPos = 10536
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BinaryDataWidget.bf"
TabWidth = 149.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\ui\\BinaryDataWidget.bf"
CursorPos = 87580
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BfIRBuilder.cpp"
TabWidth = 116.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfIRBuilder.cpp"
CursorPos = 132547
ProjectName = "IDEHelper"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BfIRCodeGen.cpp"
TabWidth = 131.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfIRCodeGen.cpp"
CursorPos = 124783
ProjectName = "IDEHelper"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "memory"
TabWidth = 78.0
Type = "SourceViewPanel"
FilePath = "c:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Tools\\MSVC\\14.21.27702\\include\\memory"
CursorPos = 68115
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Verifier.cpp"
TabWidth = 96.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\Verifier.cpp"
CursorPos = 189261
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BfExprEvaluator.cpp"
TabWidth = 145.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfExprEvaluator.cpp"
CursorPos = 395532
ProjectName = "IDEHelper"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BfModule.cpp"
TabWidth = 111.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfModule.cpp"
CursorPos = 701696
VertPos = 303765.0
ProjectName = "IDEHelper"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Result.bf"
TabWidth = 80.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Result.bf"
CursorPos = 699
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "LegacyPassManager.cpp"
TabWidth = 173.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\LegacyPassManager.cpp"
CursorPos = 56552
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "LexicalScopes.cpp"
TabWidth = 135.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\CodeGen\\LexicalScopes.cpp"
CursorPos = 6263
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "TimeZoneInfo.bf"
TabWidth = 124.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\TimeZoneInfo.bf"
CursorPos = 118021
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Windows.bf"
TabWidth = 98.0
Type = "SourceViewPanel"
FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Windows.bf"
CursorPos = 40234
ProjectName = "corlib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Platform.cpp"
TabWidth = 104.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\BeefySysLib\\platform\\win\\Platform.cpp"
CursorPos = 59719
ProjectName = "BeefySysLib"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BfCompiler.bf"
TabWidth = 108.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\Compiler\\BfCompiler.bf"
CursorPos = 7397
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BfCompiler.cpp"
TabWidth = 118.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfCompiler.cpp"
CursorPos = 181147
VertPos = 82605.0
ProjectName = "IDEHelper"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "WinDebugger.cpp"
TabWidth = 135.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\IDEHelper\\WinDebugger.cpp"
CursorPos = 120268
ProjectName = "Debugger64"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "BuildContext.bf"
TabWidth = 117.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\BuildContext.bf"
CursorPos = 3642
VertPos = 1395.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
Active = true
TabLabel = "IDEApp.bf"
TabWidth = 88.0
Type = "SourceViewPanel"
FilePath = "c:\\beef\\ide\\src\\IDEApp.bf"
CursorPos = 320852
VertPos = 158655.0
ProjectName = "IDE"
[[MainDockingFrame.DockedWidgets]]
RequestedWidth = 250.0
RequestedHeight = 408.0
Type = "DockingFrame"
SplitType = 1
[[MainDockingFrame.DockedWidgets.DockedWidgets]]
RequestedWidth = 250.0
RequestedHeight = 250.0
SizePriority = 0.4483547
Type = "TabbedView"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Profile"
TabWidth = 87.0
Type = "ProfilePanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Breakpoints"
TabWidth = 118.0
Type = "BreakpointPanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Memory"
TabWidth = 99.0
Type = "MemoryPanel"
AutoResize = "Auto_Mul8"
RequestedWidth = 104.0
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
Active = true
TabLabel = "Watch"
TabWidth = 86.0
Type = "WatchPanel"
Columns = [{Width = 306.0}, {Width = 675.0}, {Width = 200.0}]
Items = ["this", "instIdx", "mcBlock", "bfProject", "gApp", ""]
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Auto"
TabWidth = 77.0
Type = "AutoWatchPanel"
Columns = [{Width = 200.0}, {Width = 442.0}, {Width = 200.0}]
[[MainDockingFrame.DockedWidgets.DockedWidgets]]
RequestedWidth = 910.0
RequestedHeight = 793.0
SizePriority = 0.1984133
Type = "TabbedView"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
Active = true
TabLabel = "Immediate"
TabWidth = 111.0
Type = "ImmediatePanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets]]
RequestedWidth = 250.0
RequestedHeight = 250.0
SizePriority = 0.353232
Type = "TabbedView"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Find Results"
TabWidth = 119.0
Type = "FindResultsPanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Threads"
TabWidth = 97.0
Type = "ThreadPanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
TabLabel = "Call Stack"
TabWidth = 105.0
Type = "CallStackPanel"
[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
Active = true
TabLabel = "Output"
TabWidth = 90.0
Type = "OutputPanel"
[[Breakpoints]]
File = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\Verifier.cpp"
Line = 4875
Column = 6
[[Breakpoints]]
File = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\Verifier.cpp"
Line = 214
Column = 4
[[Breakpoints]]
File = "c:\\beef\\ide\\src\\Workspace.bf"
Line = 661
Column = 3
[[Bookmarks]]
File = "c:\\beef\\ide\\src\\BuildContext.bf"
Line = 465
Column = 6
[[Bookmarks]]
File = "c:\\beef\\ide\\src\\BuildContext.bf"
Line = 465
Column = 6
[DebuggerDisplayTypes.""]
IntDisplayType = "Hexadecimal"
MmDisplayType = "Default"

View file

@ -14,6 +14,6 @@ DeleteFile("$(WorkspaceDir)/src/ClassA2.bf")
# File race condition
Sleep(2000)
StepOver()
RunWithStep()
StepOver()
AssertEvalEquals("a", "19")

View file

@ -16,6 +16,6 @@ DeleteFile("$(WorkspaceDir)/src/ClassA2.bf")
# File race condition
Sleep(2000)
StepOver()
RunWithStep()
StepOver()
AssertEvalEquals("a", "19")

View file

@ -2,6 +2,7 @@ FileVersion = 1
[Project]
Name = "IDETest"
TargetType = "BeefWindowsApplication"
StartupObject = "IDETest.Program"
[Configs.Debug.Win64]

View file

@ -5,6 +5,9 @@ RunWithCompiling()
ToggleCommentAt("ClassC_0")
ToggleCommentAt("DoTest0_Body")
Stop()
Compile()
# DoTest0

View file

@ -9,6 +9,7 @@ ToggleCommentAt("Test01_mA2")
SetExpectError("data changes")
Compile()
ExpectError()
StepOver()
StepOver()
Compile()

View file

@ -21,12 +21,11 @@ ToggleCommentAt("IHot_IHotB")
ToggleCommentAt("HotTester_TestIHotB")
Compile()
Stop()
# Steps out
StepOver()
# We need an extra step for Win32 for stack adjustment...
if (platform == "Win32") StepOver()
StepInto()
StepOver()
StepOver()

View file

@ -1,3 +1,6 @@
# This test fails on Win32 currently
if (platform != "Win64") Stop()
ShowFile("src/HotSwap_TLS.bf")
GotoText("//Test_Start")
ToggleBreakpoint()

View file

@ -1,3 +1,6 @@
# This test fails on Win32 currently
if (platform != "Win64") Stop()
# Tests that even when removing an old virtual method, adding a new one, and then
# adding back a method with the same name as the old one, we can call this new
# method using an old virtual call

View file

@ -11,4 +11,8 @@ StepOver()
AssertEvalEquals("argA", "11")
StepOut()
# For LLVM generation, there's an extra step required here
if (optlevel != "Og+") StepOver()
AssertEvalEquals("c", "13")

View file

@ -75,6 +75,8 @@ RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "9")
Stop()
# Set up the StepOut test
StepInto()
StepOver()

View file

@ -1,3 +1,6 @@
# This test fails on Win32 currently
if (platform != "Win64") Stop()
# This test ensure that other threads continue to execute while we execute a method in the debugger
# and it tests that we can execute methods on threads other than those which we had originally stopped on
@ -21,6 +24,7 @@ SelectThread("")
SelectCallStackWithStr(".DoTest()")
AssertEvalEquals("ca.mA", "9")
AssertEvalEquals("sVal1", "0")
AssertEvalEquals("ca.GetValWithWait()", "9")
AssertEvalEquals("sVal1", "1")
Continue()

View file

@ -16,7 +16,6 @@ AssertEvalEquals("us.mInnerB.mInnerA.mInt1", "23")
StepOut()
StepOver()
StepOver()
StepInto()
StepOver()
StepOver()

View file

@ -85,6 +85,7 @@ namespace IDETest
static void DoTest0()
{
//PrintF("Hey!\n");
/*DoTest0_Body
ClassC cc = scope .();
int a0 = cc.MethodA0();

View file

@ -233,7 +233,8 @@ namespace Hey.Dude.Bro
}
//PrintF("%ld\n", foo((int32*)&l, &l));
return foo((int32*)&l, &l);
//return foo((int32*)&l, &l);
return 1;
}
}
}

View file

@ -1,5 +1,7 @@
class Snorf
{
int mA;
struct Bloog
{
int mA;

View file

@ -80,7 +80,6 @@ class ClassF : ClassE
}
[NoDiscard("Use this value!")]
struct TestStruct
{
@ -102,9 +101,46 @@ class Blurg
PrintF("Poofs2!\n");
}
public static void Hey()
static void Test0()
{
Snorf sn = scope .();
int a = 124;
}
public void DoRecurse(int depth, ref int val)
{
Thread.Sleep(1);
++val;
if (val < 5)
{
DoRecurse(depth + 1, ref val);
}
}
public static void VoidCall()
{
}
public static int GetInt()
{
return 123;
}
public static void Hey()
{
VoidCall();
int val0 = GetInt();
Blurg bl = scope .();
int val = 0;
bl.DoRecurse(0, ref val);
Test0();
Test0();
Test0();
Test0();
Result<void*> voidPtrResult = default;

View file

@ -132,17 +132,16 @@ namespace IDE
continue;
}
let targetCompleteCmd = new IDEApp.TargetCompletedCmd(project);
if (didCommands)
{
mScriptManager.QueueCommands(scope String()..AppendF("%targetComplete {}", project.mProjectName), targetName, .NoLines);
let targetCompleteCmd = new IDEApp.TargetCompletedCmd(project);
targetCompleteCmd.mIsReady = false;
gApp.mExecutionQueue.Add(targetCompleteCmd);
project.mNeedsTargetRebuild = true;
}
gApp.mExecutionQueue.Add(targetCompleteCmd);
return didCommands ? .HadCommands : .Failed;
return didCommands ? .HadCommands : .NoCommands;
}
bool QueueProjectGNULink(Project project, String targetPath, Workspace.Options workspaceOptions, Project.Options options, String objectsArg)
@ -558,6 +557,15 @@ namespace IDE
}
}
if (depProject.mGeneralOptions.mTargetType == .BeefLib)
{
let depProjectOptions = gApp.GetCurProjectOptions(depProject);
var linkFlags = scope String();
gApp.ResolveConfigString(workspaceOptions, depProject, depProjectOptions, depProjectOptions.mBuildOptions.mOtherLinkFlags, "link flags", linkFlags);
if (!linkFlags.IsWhiteSpace)
linkLine.Append(linkFlags, " ");
}
/*String depLibTargetPath = scope String();
ResolveConfigString(depProject, depOptions, "$(TargetPath)", error, depLibTargetPath);
@ -901,12 +909,15 @@ namespace IDE
}
}
switch (QueueProjectCustomBuildCommands(project, targetPath, runAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
if (hotProject == null)
{
case .NoCommands:
case .HadCommands:
case .Failed:
completedCompileCmd.mFailed = true;
switch (QueueProjectCustomBuildCommands(project, targetPath, runAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
{
case .NoCommands:
case .HadCommands:
case .Failed:
completedCompileCmd.mFailed = true;
}
}
if (project.mGeneralOptions.mTargetType == .CustomBuild)

View file

@ -368,6 +368,10 @@ namespace IDE
class StartDebugCmd : ExecutionCmd
{
public bool mWasCompiled;
public this()
{
}
}
public class TargetCompletedCmd : ExecutionCmd
@ -3716,6 +3720,8 @@ namespace IDE
return;
if (mHotResolveState != .None)
return;
if (IsCompiling)
return;
if (mWorkspace.mProjects.IsEmpty)
{
@ -3765,6 +3771,13 @@ namespace IDE
}
}
[IDECommand]
void RunWithStep()
{
mTargetStartWithStep = true;
CompileAndRun();
}
[IDECommand]
void StepInto()
{
@ -3778,8 +3791,7 @@ namespace IDE
}
else
{
mTargetStartWithStep = true;
CompileAndRun();
RunWithStep();
}
}
@ -3802,8 +3814,7 @@ namespace IDE
mRunTimingProfileId = Profiler.StartSampling("RunTiming");
}
mTargetStartWithStep = true;
CompileAndRun();
RunWithStep();
}
}
@ -4166,7 +4177,7 @@ namespace IDE
ShowTab(panel, label, false, setFocus);
if (setFocus)
panel.FocusForKeyboard();
if (!panel.mWidgetWindow.mHasFocus)
if ((!panel.mWidgetWindow.mHasFocus) && (!mRunningTestScript))
panel.mWidgetWindow.SetForeground();
}
@ -5559,7 +5570,7 @@ namespace IDE
//sourceViewPanel.QueueFullRefresh(true);
}
if ((sourceViewPanel.mWidgetWindow != null) && (!HasModalDialogs()))
if ((sourceViewPanel.mWidgetWindow != null) && (!HasModalDialogs()) && (!mRunningTestScript))
sourceViewPanel.mWidgetWindow.SetForeground();
sourceViewPanelTab.Activate(setFocus);
sourceViewPanelTab.mTabbedView.FinishTabAnim();
@ -7171,6 +7182,13 @@ namespace IDE
}*/
}
bool buildFailed = false;
if ((mBuildContext != null) && (mBuildContext.Failed))
buildFailed = true;
let buildCompleteCmd = GetBuildCompletedCmd();
if ((buildCompleteCmd != null) && (buildCompleteCmd.mFailed))
buildFailed = true;
bool canExecuteNext = false;
int32 parallelExecutionCount = 16;
if ((mExecutionQueue.Count > 0) && (mExecutionInstances.Count < parallelExecutionCount))
@ -7202,6 +7220,7 @@ namespace IDE
#endif
if ((next is ProcessBfCompileCmd) && (mBfBuildCompiler.HasQueuedCommands() || (waitForBuildClang)))
return;
/*if (next is BuildCompletedCmd)
{
if (mBuildContext != null)
@ -7279,19 +7298,25 @@ namespace IDE
}
else if (next is TargetCompletedCmd)
{
var targetCompletedCmd = (TargetCompletedCmd)next;
targetCompletedCmd.mProject.mNeedsTargetRebuild = false;
targetCompletedCmd.mProject.mForceCustomCommands = false;
if (!buildFailed)
{
var targetCompletedCmd = (TargetCompletedCmd)next;
targetCompletedCmd.mProject.mNeedsTargetRebuild = false;
targetCompletedCmd.mProject.mForceCustomCommands = false;
}
}
else if (next is StartDebugCmd)
{
var startDebugCmd = (StartDebugCmd)next;
if (DebugProject(startDebugCmd.mWasCompiled))
{
OutputLine("Debugger started");
}
else
OutputLine("Failed to start debugger");
if (!buildFailed)
{
var startDebugCmd = (StartDebugCmd)next;
if (DebugProject(startDebugCmd.mWasCompiled))
{
OutputLine("Debugger started");
}
else
OutputLine("Failed to start debugger");
}
}
else if (next is ExecutionQueueCmd)
{
@ -7319,12 +7344,9 @@ namespace IDE
if (!completedCompileCmd.mFailed)
mDepClang.mDoDependencyCheck = false;
#endif
if (mBuildContext != null)
{
if (mBuildContext.Failed)
buildCompletedCmd.mFailed = true;
}
if (buildFailed)
buildCompletedCmd.mFailed = true;
CompileResult(buildCompletedCmd.mHotProjectName, !buildCompletedCmd.mFailed);
if (buildCompletedCmd.mFailed)
@ -8045,6 +8067,22 @@ namespace IDE
newString = options.mDebugOptions.mCommandArguments;
case "WorkingDir":
newString = options.mDebugOptions.mWorkingDirectory;
case "TargetDir":
{
if (project.IsDebugSession)
{
let targetPath = scope:ReplaceBlock String();
DoResolveConfigString(workspaceOptions, project, options, options.mBuildOptions.mTargetName, error, targetPath);
newString = scope:ReplaceBlock String();
Path.GetDirectoryPath(targetPath, newString);
break;
}
String targetDir = scope String();
DoResolveConfigString(workspaceOptions, project, options, options.mBuildOptions.mTargetDirectory, error, targetDir);
newString = scope:ReplaceBlock String();
Path.GetAbsolutePath(targetDir, project.mProjectDir, newString);
}
case "TargetPath":
{
if (project.IsDebugSession)
@ -8087,24 +8125,30 @@ namespace IDE
//Debug.WriteLine("BuildDir: {0}", newString);
case "LinkFlags":
newString = scope:ReplaceBlock String();
#if BF_PLATFORM_WINDOWS
String rtName = scope String();
String dbgName = scope String();
BuildContext.GetRtLibNames(workspaceOptions, options, false, rtName, dbgName);
newString.Append(rtName);
if (!dbgName.IsEmpty)
newString.Append(" ", dbgName);
switch (workspaceOptions.mAllocType)
if ((project.mGeneralOptions.mTargetType == .BeefConsoleApplication) ||
(project.mGeneralOptions.mTargetType == .BeefWindowsApplication) ||
(project.mGeneralOptions.mTargetType == .BeefDynLib))
{
case .JEMalloc:
newString.Append(" jemalloc.lib");
case .TCMalloc:
newString.Append(" tcmalloc.lib");
default:
}
#if BF_PLATFORM_WINDOWS
String rtName = scope String();
String dbgName = scope String();
BuildContext.GetRtLibNames(workspaceOptions, options, false, rtName, dbgName);
newString.Append(rtName);
if (!dbgName.IsEmpty)
newString.Append(" ", dbgName);
switch (workspaceOptions.mAllocType)
{
case .JEMalloc:
newString.Append(" jemalloc.lib");
case .TCMalloc:
newString.Append(" tcmalloc.lib");
default:
}
#else
newString.Append("./libBeefRT_d.so -Wl,-rpath -Wl,.");
#endif
}
case "VSToolPath":
if (workspaceOptions.mMachineType.PtrSize == 4)
newString = gApp.mSettings.mVSSettings.mBin32Path;
@ -8895,6 +8939,8 @@ namespace IDE
{
if (AreTestsRunning())
return false;
if (IsCompiling)
return false;
if (!mExecutionQueue.IsEmpty)
{
@ -8957,6 +9003,8 @@ namespace IDE
protected bool Compile(CompileKind compileKind = .Normal, Project hotProject = null)
{
Debug.Assert(mBuildContext == null);
if (mDbgCompileDump)
{
mDbgCompileIdx++;
@ -9588,13 +9636,15 @@ namespace IDE
//
{
BFWindow.Flags flags = .Border | .ThickFrame | .Resizable | .SysMenu |
.Caption | .Minimize | .Maximize | .QuitOnClose | .Menu;
if (mRunningTestScript)
flags |= .NoActivate;
scope AutoBeefPerf("IDEApp.Init:CreateMainWindow");
mMainWindow = new WidgetWindow(null, "Beef IDE", (int32)mRequestedWindowRect.mX,
(int32)mRequestedWindowRect.mY, (int32)mRequestedWindowRect.mWidth, (int32)mRequestedWindowRect.mHeight,
BFWindow.Flags.Border | BFWindow.Flags.ThickFrame | BFWindow.Flags.Resizable | BFWindow.Flags.SysMenu |
BFWindow.Flags.Caption | BFWindow.Flags.Minimize | BFWindow.Flags.Maximize | BFWindow.Flags.QuitOnClose |
BFWindow.Flags.Menu,
mMainFrame);
flags, mMainFrame);
}
UpdateTitle();
mMainWindow.SetMinimumSize(GS!(480), GS!(360));
@ -10670,7 +10720,7 @@ namespace IDE
}
}
if (!HasModalDialogs())
if ((!HasModalDialogs()) && (!mRunningTestScript))
mMainWindow.SetForeground();
if (mRunTimingProfileId != 0)

View file

@ -25,7 +25,7 @@ namespace IDE
#if SMALLTEST
Debug.WriteLine("Hey!\n");
#else
IDEApp mApp = new IDEApp();
IDEApp mApp = new IDEApp();
mApp.ParseCommandLine(args);
mApp.Init();

View file

@ -186,6 +186,7 @@ namespace IDE
{
DeleteAndClearItems!(mCmdList);
mFailed = false;
mCurCmd = null;
}
public void QueueCommands(StreamReader streamReader, StringView filePath, CmdFlags flags)
@ -466,6 +467,9 @@ namespace IDE
methodName = cmd;
}
if (mFailed)
return;
Target curTarget = mRoot;
for (var cmdPart in methodName.Split('.'))
{
@ -574,6 +578,16 @@ namespace IDE
return gApp.mPlatformName;
else if (token == "config")
return gApp.mConfigName;
else if (token == "optlevel")
{
var workspaceOptions = gApp.GetCurWorkspaceOptions();
if (workspaceOptions != null)
{
String str = new:tempAlloc .();
workspaceOptions.mBfOptimizationLevel.ToString(str);
return str;
}
}
return null;
}
@ -665,7 +679,7 @@ namespace IDE
if (doExec)
{
Exec(mCurCmd.mCmd);
mCurCmd.mExecIdx++;
mCurCmd?.mExecIdx++;
}
if (mCmdList.IsEmpty)
@ -888,7 +902,7 @@ namespace IDE
return false;
}
if (gApp.mBfResolveCompiler.IsPerformingBackgroundOperation())
if ((gApp.mBfResolveCompiler != null) && (gApp.mBfResolveCompiler.IsPerformingBackgroundOperation()))
return false;
if (gApp.[Friend]mDeferredOpen != .None)
return false;
@ -910,6 +924,9 @@ namespace IDE
if (!gApp.[Friend]mExecutionInstances.IsEmpty)
return false;
if (gApp.mDebugger == null)
return true;
if ((!gApp.AreTestsRunning()) && (!gApp.mDebugger.HasPendingDebugLoads()) &&
((gApp.mExecutionPaused) || (!gApp.mDebugger.mIsRunning)))
{
@ -929,6 +946,9 @@ namespace IDE
return false;
}
if (runState == .Running_ToTempBreakpoint)
return false;
Debug.Assert((runState == .NotStarted) || (runState == .Paused) || (runState == .Running_ToTempBreakpoint) ||
(runState == .Exception) || (runState == .Breakpoint) || (runState == .Terminated));
/*if (runState == .Paused)
@ -1133,6 +1153,62 @@ namespace IDE
}
}
public Project GetProject()
{
if (mScriptManager.mProjectName == null)
{
mScriptManager.Fail("Only usable in the context of a project");
return null;
}
let project = gApp.mWorkspace.FindProject(mScriptManager.mProjectName);
if (project == null)
{
mScriptManager.Fail("Unable to find project '{}'", mScriptManager.mProjectName);
return null;
}
return project;
}
[IDECommand]
public void CopyToDependents(String srcPath)
{
let depProject = GetProject();
if (depProject == null)
return;
for (let checkProject in gApp.mWorkspace.mProjects)
{
if (checkProject.HasDependency(depProject.mProjectName))
{
String fileName = scope .();
Path.GetFileName(srcPath, fileName);
List<String> targetPaths = scope .();
defer ClearAndDeleteItems(targetPaths);
let workspaceOptions = gApp.GetCurWorkspaceOptions();
let options = gApp.GetCurProjectOptions(checkProject);
gApp.[Friend]GetTargetPaths(checkProject, workspaceOptions, options, targetPaths);
if (!targetPaths.IsEmpty)
{
String targetDirPath = scope .();
Path.GetDirectoryPath(targetPaths[0], targetDirPath);
String destPath = scope .();
Path.GetAbsolutePath(fileName, targetDirPath, destPath);
if (File.CopyIfNewer(srcPath, destPath) case .Err)
{
mScriptManager.Fail("Failed to copy file '{}' to '{}'", srcPath, destPath);
return;
}
}
}
}
}
[IDECommand]
public void ExecuteRaw(String cmd)
{
@ -1353,6 +1429,49 @@ namespace IDE
ScriptManager.sActiveManager.Fail("Failed to find stack frame containing string '{}'", str);
}
public bool AssertRunning()
{
if (!gApp.mDebugger.mIsRunning)
{
mScriptManager.Fail("Expected target to be running");
return false;
}
return true;
}
public bool AssertDebuggerPaused()
{
if (!gApp.mDebugger.mIsRunning)
{
mScriptManager.Fail("Expected target to be running");
return false;
}
if (!gApp.mDebugger.IsPaused())
{
mScriptManager.Fail("Expected target to be paused");
return false;
}
return true;
}
[IDECommand]
public void StepInto()
{
if (!AssertDebuggerPaused())
return;
gApp.[Friend]StepInto();
}
[IDECommand]
public void StepOver()
{
if (!AssertDebuggerPaused())
return;
gApp.[Friend]StepOver();
}
[IDECommand]
public void SelectThread(String threadName)
{
@ -1948,7 +2067,7 @@ namespace IDE
[IDECommand]
public void Stop()
{
ScriptManager.sActiveManager.Clear();
mScriptManager.Clear();
}
[IDECommand]

View file

@ -351,13 +351,21 @@ namespace IDE.ui
IDEUtils.FixFilePath(targetPath);
String workingDir = scope String();
//
workingDir.Append(mWorkingDirCombo.Label);
if (Path.IsPathRooted(workingDir))
{
String relWorkingDir = scope String();
relWorkingDir.Append(mWorkingDirCombo.Label);
if (!workingDir.IsWhiteSpace)
defer targetPath.Remove(0, targetPath.Length);
Path.GetAbsolutePath(targetPath, workingDir, targetPath);
}
else
{
String targetDir = scope .();
Path.GetDirectoryPath(targetPath, targetDir);
if (!targetDir.IsWhiteSpace)
{
Path.GetAbsolutePath(targetPath, relWorkingDir, workingDir);
defer workingDir.Remove(0, workingDir.Length);
Path.GetAbsolutePath(workingDir, targetDir, workingDir);
}
}

View file

@ -2324,8 +2324,12 @@ namespace IDE.ui
}
public void FocusEdit()
{
GetActivePanel().mEditWidget.SetFocus();
{
let activePanel = GetActivePanel();
activePanel.mEditWidget.SetFocus();
if (!mWidgetWindow.mHasFocus)
EditGotFocus();
}
public override void SetFocus()