@@ -301,22 +301,24 @@ schedule thread@Thread{
301
301
let thread' = thread { threadControl = ThreadControl (k x) ctl'
302
302
, threadMasking = maskst' }
303
303
-- but if we're now unmasked, check for any pending async exceptions
304
- deschedule Interruptable thread' simstate
304
+ trace <- deschedule Interruptable thread' simstate
305
+ return (SimTrace time tid tlbl (EventMask maskst') trace)
305
306
306
307
CatchFrame _handler k ctl' -> do
307
308
-- pop the control stack and continue
308
309
let thread' = thread { threadControl = ThreadControl (k x) ctl' }
309
310
schedule thread' simstate
310
311
311
312
Throw e -> case unwindControlStack e thread of
312
- Right thread0 -> do
313
+ Right thread0@ Thread { threadMasking = maskst' } -> do
313
314
-- We found a suitable exception handler, continue with that
314
315
-- We record a step, in case there is no exception handler on replay.
315
316
let thread' = stepThread thread0
316
317
control' = advanceControl (threadStepId thread0) control
317
318
races' = updateRacesInSimState thread0 simstate
318
319
trace <- schedule thread' simstate{ races = races', control = control' }
319
- return (SimTrace time tid tlbl (EventThrow e) trace)
320
+ return (SimTrace time tid tlbl (EventThrow e) $
321
+ SimTrace time tid tlbl (EventMask maskst') trace)
320
322
321
323
Left isMain
322
324
-- We unwound and did not find any suitable exception handler, so we
@@ -583,10 +585,12 @@ schedule thread@Thread{
583
585
(runIOSim action')
584
586
(MaskFrame k maskst ctl)
585
587
, threadMasking = maskst' }
586
- case maskst' of
587
- -- If we're now unmasked then check for any pending async exceptions
588
- Unmasked -> deschedule Interruptable thread' simstate
589
- _ -> schedule thread' simstate
588
+ trace <-
589
+ case maskst' of
590
+ -- If we're now unmasked then check for any pending async exceptions
591
+ Unmasked -> deschedule Interruptable thread' simstate
592
+ _ -> schedule thread' simstate
593
+ return (SimTrace time tid tlbl (EventMask maskst') trace)
590
594
591
595
ThrowTo e tid' _ | tid' == tid -> do
592
596
-- Throw to ourself is equivalent to a synchronous throw,
0 commit comments