Skip to content

[Bug]: Editor Crash (Division by 0 error) when debugging #9

Open
@boriel

Description

@boriel

Contact Details

@boriel

IDE version

0.3

What happened?

When debugging the following program:

function third(a() as Ubyte) as Ubyte
   Dim b as Ubyte
   b = a(3, 4, 1)
   PRINT b
   return b
end Function

DIM a(2 to 5, 3 To 6, 2) as Ubyte

a(3, 4, 1) = 3
third(a)

if we put a break point in line which reads b = a(3, 4, 1) and start debugging, the executions halts as expected.
Hitting then key F9 (continue next asm instruction) crashes the editor with the error below (see next section).

Error and Warning messages

Lib audio: /home/boriel/src/boriel-basic/zxbasic/scratch/libportaudio.so
Unhandled exception. System.DivideByZeroException: Attempted to divide by zero.
   at ZXBasicStudio.BuildSystem.ZXVariableHelper.GetArrayDescriptor(IMemory Memory, UInt16 Address) in /home/boriel/src/boriel-basic/ZXBasicStudio/ZXBStudio/BuildSystem/ZXVariableHelper.cs:line 134
   at ZXBasicStudio.BuildSystem.ZXVariable.GetArrayDescriptor(IMemory Memory, IZ80Registers Registers) in /home/boriel/src/boriel-basic/ZXBasicStudio/ZXBStudio/BuildSystem/ZXVariable.cs:line 68
   at ZXBasicStudio.DebuggingTools.Variables.Controls.ZXVariablesView.BeginEdit() in /home/boriel/src/boriel-basic/ZXBasicStudio/ZXBStudio/DebuggingTools/Variables/Controls/ZXVariablesView.axaml.cs:line 82
   at ZXBasicStudio.MainWindow.AssemblerStepEmulator(Object sender, RoutedEventArgs e) in /home/boriel/src/boriel-basic/ZXBasicStudio/ZXBStudio/MainWindow.axaml.cs:line 1184
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()
   at Avalonia.Threading.DispatcherOperation.Execute()
   at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job)
   at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback)
   at Avalonia.Threading.Dispatcher.Signaled()
   at Avalonia.X11.X11PlatformThreading.CheckSignaled()
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
   at ZXBasicStudio.Program.Main(String[] args) in /home/boriel/src/boriel-basic/ZXBasicStudio/ZXBStudio/Program.cs:line 23
Aborted (core dumped)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions