Skip to content

Commit f2ba598

Browse files
author
Juan Segura
committed
Bug #17: Breakpoints in included files are ignored
1 parent 78280c8 commit f2ba598

File tree

4 files changed

+33
-13
lines changed

4 files changed

+33
-13
lines changed

CoreSpectrum/Hardware/SpectrumBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ public virtual void ReleaseKey(SpectrumKeys Key)
363363
protected virtual void z80_BeforeInstructionFetch(object? sender, Konamiman.Z80dotNet.BeforeInstructionFetchEventArgs e)
364364
{
365365
var bp = _breakpoints[_z80.Registers.PC];
366-
367366
if (bp == null)
368367
return;
369368

ZXBStudio/BuildSystem/ZXCodeFile.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private string GetSourceLine(int lineNum, string line)
100100
return $"file__{FileGuid}__{lineNum}:\n{line}";
101101
}
102102

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

241-
var codeFile = AllFiles.FirstOrDefault(f => f.AbsolutePath == absoluteFile);
241+
var codeFile = AllFiles.FirstOrDefault(f => f.AbsolutePath.ToLower() == absoluteFile.ToLower());
242242

243243
if (codeFile != null)
244244
line = line.Replace(file, Path.Combine(codeFile.Directory, codeFile.TempFileName));
@@ -279,8 +279,8 @@ public void CreateBuildFile(IEnumerable<ZXCodeFile> AllFiles)
279279
}
280280
else
281281
dotrim = false;
282-
}
283-
282+
}
283+
textWriter.WriteLine($"Crating temp file: {TempFileName}");
284284
File.WriteAllText(Path.Combine(Directory, TempFileName), sb.ToString());
285285
}
286286
}

ZXBStudio/BuildSystem/ZXProjectBuilder.cs

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ private static void CheckNextCreator()
278278

279279
public static ZXProgram? BuildDebug(TextWriter OutputLogWritter)
280280
{
281+
string cmd = "";
282+
281283
try
282284
{
283285
if (ZXProjectManager.Current == null)
@@ -332,7 +334,7 @@ private static void CheckNextCreator()
332334

333335
foreach (var file in files)
334336
{
335-
file.CreateBuildFile(files);
337+
file.CreateBuildFile(files, OutputLogWritter);
336338
}
337339

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

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

354358
OutputProcessLog(OutputLogWritter, proc, out logOutput);
355359

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

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

416-
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 });
422+
proc = Process.Start(
423+
new ProcessStartInfo(
424+
Path.GetFullPath(ZXOptions.Current.ZxbcPath), cmd)
425+
{
426+
WorkingDirectory = project.ProjectPath,
427+
RedirectStandardError = true,
428+
CreateNoWindow = true
429+
});
417430

418431
OutputProcessLog(OutputLogWritter, proc, out logOutput);
419432

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

434-
disasFile.CreateBuildFile(files);
447+
disasFile.CreateBuildFile(files, OutputLogWritter);
435448

436-
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 });
449+
cmd = $"\"{Path.Combine(disasFile.Directory, disasFile.TempFileName)}\" -M MEMORY_MAP";
450+
proc = Process.Start(
451+
new ProcessStartInfo(
452+
Path.GetFullPath(ZXOptions.Current.ZxbasmPath), cmd)
453+
{
454+
WorkingDirectory = project.ProjectPath,
455+
RedirectStandardError = true,
456+
CreateNoWindow = true
457+
});
437458

438459
OutputProcessLog(OutputLogWritter, proc, out logOutput);
439460

ZXBStudio/Dialogs/ZXAboutDialog.axaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public ZXAboutDialog()
1212
{
1313
InitializeComponent();
1414

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

1818
btnClose.Click += BtnClose_Click;
1919

0 commit comments

Comments
 (0)