Skip to content

Commit a288a4b

Browse files
committed
Add missing FrameEvaluate isFrameBreakpoint checks
1 parent d2af1ad commit a288a4b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Common/src/main/kotlin/gay/object/hexdebug/debugger/HexDebugger.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class HexDebugger(
113113
}
114114

115115
private fun getIotas(frame: ContinuationFrame) = when (frame) {
116-
is FrameEvaluate -> frame.list
116+
is FrameEvaluate -> if (frame.isFrameBreakpoint) null else frame.list
117117
is FrameForEach -> frame.code
118118
else -> null
119119
}
@@ -457,7 +457,7 @@ class HexDebugger(
457457
}
458458

459459
// TODO: scuffed
460-
val cast = if (frame is FrameEvaluate && frame.list.nonEmpty) {
460+
val cast = if (frame is FrameEvaluate && !frame.isFrameBreakpoint && frame.list.nonEmpty) {
461461
frame.list.car
462462
} else NullIota()
463463

@@ -549,14 +549,14 @@ class HexDebugger(
549549

550550
// directly copied from CastingHarness
551551
private fun getPatternForFrame(frame: ContinuationFrame): HexPattern? {
552-
if (frame !is FrameEvaluate) return null
552+
if (frame !is FrameEvaluate || frame.isFrameBreakpoint) return null
553553

554554
return (frame.list.car as? PatternIota)?.pattern
555555
}
556556

557557
// directly copied from CastingHarness
558558
private fun getOperatorForFrame(frame: ContinuationFrame, world: ServerLevel): Action? {
559-
if (frame !is FrameEvaluate) return null
559+
if (frame !is FrameEvaluate || frame.isFrameBreakpoint) return null
560560

561561
return getOperatorForPattern(frame.list.car, world)
562562
}
@@ -653,12 +653,13 @@ class HexDebugger(
653653

654654
if (stepType == DebugStepType.IN) {
655655
trySetIotaOverride(newContinuation, cast)
656-
if (nextFrame !is FrameEvaluate) {
656+
if (nextFrame !is FrameEvaluate || nextFrame.isFrameBreakpoint) {
657657
trySetIotaOverride(nextContinuation, cast)
658658
}
659659
} else if (
660660
frame is FrameForEach
661661
&& newFrame is FrameEvaluate
662+
&& !newFrame.isFrameBreakpoint
662663
&& nextFrame is FrameForEach
663664
&& frame.code === newFrame.list
664665
&& frame.code === nextFrame.code

0 commit comments

Comments
 (0)