Skip to content

fix: Internal debugger crash when instruction would read 2 bytes starting at 0xFFFF#2260

Merged
maximilien-noal merged 1 commit into
OpenRakis:masterfrom
brunom:fix/debugger_segment_overflow
Jul 13, 2026
Merged

fix: Internal debugger crash when instruction would read 2 bytes starting at 0xFFFF#2260
maximilien-noal merged 1 commit into
OpenRakis:masterfrom
brunom:fix/debugger_segment_overflow

Conversation

@brunom

@brunom brunom commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

When a function exit poped 0xffff into si, an instruction far away that read 16 bits from si made the debugger crash because it extended past the segment end. Now the debugger shows no actual values for that instruction, but should be fixed when it's about to execute and registers have differente values.

Copilot AI review requested due to automatic review settings July 12, 2026 22:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a crash in the internal debugger’s disassembly operand evaluation when an instruction’s operand evaluation attempts to read past the end of a real-mode segment (e.g., reading a 16-bit value starting at offset 0xFFFF). The change ensures the UI no longer crashes during operand evaluation while paused.

Changes:

  • Wrapped operand evaluation in DisassemblyViewModel.EvaluateOperands() with exception handling to prevent UI crashes.
  • On evaluation failure, clears/hides evaluated operand values for the affected disassembly line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Spice86/ViewModels/DisassemblyViewModel.cs
Comment thread src/Spice86/ViewModels/DisassemblyViewModel.cs Dismissed
@maximilien-noal maximilien-noal added UI UI work Debugger Related to the internal debugger or to the breakpoint framework bugfix fixes a bug labels Jul 13, 2026
@maximilien-noal
maximilien-noal self-requested a review July 13, 2026 19:11
@maximilien-noal

Copy link
Copy Markdown
Member

@brunom I hit this crash once in a while but forgot about it, nice to see a fix for it! Thanks!

@maximilien-noal
maximilien-noal merged commit ed76922 into OpenRakis:master Jul 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes a bug Debugger Related to the internal debugger or to the breakpoint framework UI UI work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants