Skip to content

Bug #17: Breakpoints in included files are ignored #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CoreSpectrum/Hardware/SpectrumBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ public virtual void ReleaseKey(SpectrumKeys Key)
protected virtual void z80_BeforeInstructionFetch(object? sender, Konamiman.Z80dotNet.BeforeInstructionFetchEventArgs e)
{
var bp = _breakpoints[_z80.Registers.PC];

if (bp == null)
return;

Expand Down
8 changes: 4 additions & 4 deletions ZXBStudio/BuildSystem/ZXCodeFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private string GetSourceLine(int lineNum, string line)
return $"file__{FileGuid}__{lineNum}:\n{line}";
}

public void CreateBuildFile(IEnumerable<ZXCodeFile> AllFiles)
public void CreateBuildFile(IEnumerable<ZXCodeFile> AllFiles, TextWriter textWriter)
{
string content = Content;
string[] lines = content.Replace("\r", "").Split("\n");
Expand Down Expand Up @@ -238,7 +238,7 @@ public void CreateBuildFile(IEnumerable<ZXCodeFile> AllFiles)
var file = regInclude.Match(line).Groups[1].Value;
var absoluteFile = Path.GetFullPath(Path.Combine(Directory, file));

var codeFile = AllFiles.FirstOrDefault(f => f.AbsolutePath == absoluteFile);
var codeFile = AllFiles.FirstOrDefault(f => f.AbsolutePath.ToLower() == absoluteFile.ToLower());

if (codeFile != null)
line = line.Replace(file, Path.Combine(codeFile.Directory, codeFile.TempFileName));
Expand Down Expand Up @@ -279,8 +279,8 @@ public void CreateBuildFile(IEnumerable<ZXCodeFile> AllFiles)
}
else
dotrim = false;
}

}
textWriter.WriteLine($"Crating temp file: {TempFileName}");
File.WriteAllText(Path.Combine(Directory, TempFileName), sb.ToString());
}
}
Expand Down
33 changes: 27 additions & 6 deletions ZXBStudio/BuildSystem/ZXProjectBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ private static void CheckNextCreator()

public static ZXProgram? BuildDebug(TextWriter OutputLogWritter)
{
string cmd = "";

try
{
if (ZXProjectManager.Current == null)
Expand Down Expand Up @@ -332,7 +334,7 @@ private static void CheckNextCreator()

foreach (var file in files)
{
file.CreateBuildFile(files);
file.CreateBuildFile(files, OutputLogWritter);
}

OutputLogWritter.WriteLine("Building program map...");
Expand All @@ -346,10 +348,12 @@ private static void CheckNextCreator()
return null;
}

cmd = $"\"{Path.Combine(codeFile.Directory, codeFile.TempFileName)}\" -M MEMORY_MAP " + args;
OutputLogWritter.WriteLine("zxbc "+cmd);
var proc = Process.Start(
new ProcessStartInfo(
Path.GetFullPath(ZXOptions.Current.ZxbcPath),
$"\"{Path.Combine(codeFile.Directory, codeFile.TempFileName)}\" -M MEMORY_MAP " + args) { WorkingDirectory = project.ProjectPath, RedirectStandardError = true, CreateNoWindow = true });
Path.GetFullPath(ZXOptions.Current.ZxbcPath),cmd)
{ WorkingDirectory = project.ProjectPath, RedirectStandardError = true, CreateNoWindow = true });

OutputProcessLog(OutputLogWritter, proc, out logOutput);

Expand Down Expand Up @@ -412,8 +416,17 @@ private static void CheckNextCreator()
var varMap = new ZXVariableMap(varFile, mapFile, bMap);

OutputLogWritter.WriteLine("Building disassembly...");
cmd = $"\"{Path.Combine(codeFile.Directory, codeFile.TempFileName)}\" -A " + args;
OutputLogWritter.WriteLine(cmd);

proc = Process.Start(new ProcessStartInfo(Path.GetFullPath(ZXOptions.Current.ZxbcPath), $"\"{Path.Combine(codeFile.Directory, codeFile.TempFileName)}\" -A " + args) { WorkingDirectory = project.ProjectPath, RedirectStandardError = true, CreateNoWindow = true });
proc = Process.Start(
new ProcessStartInfo(
Path.GetFullPath(ZXOptions.Current.ZxbcPath), cmd)
{
WorkingDirectory = project.ProjectPath,
RedirectStandardError = true,
CreateNoWindow = true
});

OutputProcessLog(OutputLogWritter, proc, out logOutput);

Expand All @@ -431,9 +444,17 @@ private static void CheckNextCreator()
string disFile = Path.Combine(project.ProjectPath, Path.GetFileNameWithoutExtension(Path.Combine(codeFile.Directory, codeFile.TempFileName)) + ".asm");
var disasFile = new ZXCodeFile(disFile, true);

disasFile.CreateBuildFile(files);
disasFile.CreateBuildFile(files, OutputLogWritter);

proc = Process.Start(new ProcessStartInfo(Path.GetFullPath(ZXOptions.Current.ZxbasmPath), $"\"{Path.Combine(disasFile.Directory, disasFile.TempFileName)}\" -M MEMORY_MAP") { WorkingDirectory = project.ProjectPath, RedirectStandardError = true, CreateNoWindow = true });
cmd = $"\"{Path.Combine(disasFile.Directory, disasFile.TempFileName)}\" -M MEMORY_MAP";
proc = Process.Start(
new ProcessStartInfo(
Path.GetFullPath(ZXOptions.Current.ZxbasmPath), cmd)
{
WorkingDirectory = project.ProjectPath,
RedirectStandardError = true,
CreateNoWindow = true
});

OutputProcessLog(OutputLogWritter, proc, out logOutput);

Expand Down
4 changes: 2 additions & 2 deletions ZXBStudio/Dialogs/ZXAboutDialog.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public ZXAboutDialog()
{
InitializeComponent();

txtBuild.Text = "1.6.0-beta1";
txtDate.Text = "2025-04-26";
txtBuild.Text = "1.6.0-beta2";
txtDate.Text = "2025-05-02";

btnClose.Click += BtnClose_Click;

Expand Down