|
384 | 384 | (if (cons? stat) "Change return value..." "Skip expression...")
|
385 | 385 | menu
|
386 | 386 | (lambda (item evt)
|
387 |
| - (let ([tmp (get-text-from-user "Return value" #f)]) |
388 |
| - (when tmp |
389 |
| - (let/ec k |
390 |
| - (send (get-tab) set-break-status |
391 |
| - (cons 'exit-break |
392 |
| - (call-with-values |
393 |
| - (lambda () |
394 |
| - (with-handlers ([exn:fail? (lambda (exn) |
395 |
| - (message-box |
396 |
| - "Debugger Error" |
| 387 | + (define tmp (get-text-from-user "Return value" #f)) |
| 388 | + (when tmp |
| 389 | + (let/ec k |
| 390 | + (send (get-tab) set-break-status |
| 391 | + (cons 'exit-break |
| 392 | + (call-with-values |
| 393 | + (lambda () |
| 394 | + (with-handlers ([exn:fail? |
| 395 | + (lambda (exn) |
| 396 | + (message-box "Debugger Error" |
397 | 397 | (format "An error occurred: ~a"
|
398 | 398 | (exn-message exn))
|
399 | 399 | #f
|
400 | 400 | '(ok))
|
401 |
| - (k))]) |
402 |
| - (read (open-input-string tmp)))) |
403 |
| - list))) |
404 |
| - (invalidate-bitmap-cache)))))))] |
| 401 | + (k))]) |
| 402 | + (read (open-input-string tmp)))) |
| 403 | + list))) |
| 404 | + (invalidate-bitmap-cache))))))] |
405 | 405 | [else
|
406 | 406 | (make-object menu-item%
|
407 | 407 | "Continue to this point"
|
|
521 | 521 | (define frame-num (send (get-tab) get-frame-num))
|
522 | 522 | (define break-status (send (get-tab) get-break-status))
|
523 | 523 | (when (and (eq? frame-defs this) start end)
|
524 |
| - (let*-values ([(xl yl xr yr) (find-char-box this start)] |
525 |
| - [(ym) (average yl yr)] |
526 |
| - [(xa ya xb yb) (find-char-box this end)] |
527 |
| - [(diameter) (- xb xa)] |
528 |
| - [(yoff) (/ (- yb ya diameter) 2)] |
529 |
| - [(ym2) (average ya yb)]) |
530 |
| - (let ([op (send dc get-pen)] |
531 |
| - [ob (send dc get-brush)]) |
532 |
| - (cond |
533 |
| - [(and (zero? frame-num) (eq? break-status 'error)) |
534 |
| - (send dc set-pen pc-err-pen) |
535 |
| - (send dc set-brush pc-err-brush)] |
536 |
| - [(and (zero? frame-num) (eq? break-status 'break)) |
537 |
| - (send dc set-pen pc-brk-pen) |
538 |
| - (send dc set-brush pc-brk-brush)] |
539 |
| - [(zero? frame-num) |
540 |
| - (send dc set-pen pc-pen) |
541 |
| - (send dc set-brush pc-brush)] |
542 |
| - [else |
543 |
| - (send dc set-pen pc-up-stack-pen) |
544 |
| - (send dc set-brush pc-up-stack-brush)]) |
545 |
| - (unless (and (zero? frame-num) (cons? break-status)) |
546 |
| - ;; mark the beginning of the expression with a triangle |
547 |
| - (send dc draw-polygon |
548 |
| - (list (make-object point% xl yl) |
549 |
| - (make-object point% xl yr) |
550 |
| - (make-object point% xr ym)) |
551 |
| - dx |
552 |
| - dy)) |
553 |
| - (if (and (zero? frame-num) (cons? break-status)) |
554 |
| - ;; top frame, end: mark the end of the expression with a triangle |
555 |
| - (send dc draw-polygon |
556 |
| - (list (make-object point% xa ya) |
557 |
| - (make-object point% xa yb) |
558 |
| - (make-object point% xb ym2)) |
559 |
| - dx |
560 |
| - dy) |
561 |
| - ;; otherwise: make the end of the expression with a circle |
562 |
| - (send dc draw-ellipse (+ xa dx) (+ ya dy yoff) diameter diameter)) |
563 |
| - (send dc set-pen op) |
564 |
| - (send dc set-brush ob)))))) |
| 524 | + (define-values (xl yl xr yr) (find-char-box this start)) |
| 525 | + (define ym (average yl yr)) |
| 526 | + (define-values (xa ya xb yb) (find-char-box this end)) |
| 527 | + (define diameter (- xb xa)) |
| 528 | + (define yoff (/ (- yb ya diameter) 2)) |
| 529 | + (define ym2 (average ya yb)) |
| 530 | + (define op (send dc get-pen)) |
| 531 | + (define ob (send dc get-brush)) |
| 532 | + (cond |
| 533 | + [(and (zero? frame-num) (eq? break-status 'error)) |
| 534 | + (send dc set-pen pc-err-pen) |
| 535 | + (send dc set-brush pc-err-brush)] |
| 536 | + [(and (zero? frame-num) (eq? break-status 'break)) |
| 537 | + (send dc set-pen pc-brk-pen) |
| 538 | + (send dc set-brush pc-brk-brush)] |
| 539 | + [(zero? frame-num) |
| 540 | + (send dc set-pen pc-pen) |
| 541 | + (send dc set-brush pc-brush)] |
| 542 | + [else |
| 543 | + (send dc set-pen pc-up-stack-pen) |
| 544 | + (send dc set-brush pc-up-stack-brush)]) |
| 545 | + (unless (and (zero? frame-num) (cons? break-status)) |
| 546 | + ;; mark the beginning of the expression with a triangle |
| 547 | + (send dc draw-polygon |
| 548 | + (list (make-object point% xl yl) |
| 549 | + (make-object point% xl yr) |
| 550 | + (make-object point% xr ym)) |
| 551 | + dx |
| 552 | + dy)) |
| 553 | + (if (and (zero? frame-num) (cons? break-status)) |
| 554 | + ;; top frame, end: mark the end of the expression with a triangle |
| 555 | + (send dc draw-polygon |
| 556 | + (list (make-object point% xa ya) |
| 557 | + (make-object point% xa yb) |
| 558 | + (make-object point% xb ym2)) |
| 559 | + dx |
| 560 | + dy) |
| 561 | + ;; otherwise: make the end of the expression with a circle |
| 562 | + (send dc draw-ellipse (+ xa dx) (+ ya dy yoff) diameter diameter)) |
| 563 | + (send dc set-pen op) |
| 564 | + (send dc set-brush ob)))) |
565 | 565 |
|
566 | 566 | (define/augment (after-set-next-settings s)
|
567 | 567 | (let ([tlw (get-top-level-window)])
|
|
799 | 799 | bp)))))))
|
800 | 800 | ; break-before
|
801 | 801 | (lambda (top-mark ccm)
|
802 |
| - (let* ([debug-marks (continuation-mark-set->list ccm debug-key)]) |
803 |
| - (send (get-tab) suspend oeh (cons top-mark debug-marks) 'entry-break))) |
| 802 | + (define debug-marks (continuation-mark-set->list ccm debug-key)) |
| 803 | + (send (get-tab) suspend oeh (cons top-mark debug-marks) 'entry-break)) |
804 | 804 | ; break-after
|
805 | 805 | (case-lambda
|
806 | 806 | [(top-mark ccm val)
|
|
810 | 810 | (cons top-mark debug-marks)
|
811 | 811 | (list 'exit-break val))))]
|
812 | 812 | [(top-mark ccm . vals)
|
813 |
| - (let* ([debug-marks (continuation-mark-set->list ccm debug-key)]) |
814 |
| - (apply values |
815 |
| - (send (get-tab) suspend |
816 |
| - oeh |
817 |
| - (cons top-mark debug-marks) |
818 |
| - (cons 'exit-break vals))))]))) |
| 813 | + (define debug-marks (continuation-mark-set->list ccm debug-key)) |
| 814 | + (apply values |
| 815 | + (send (get-tab) suspend |
| 816 | + oeh |
| 817 | + (cons top-mark debug-marks) |
| 818 | + (cons 'exit-break vals)))]))) |
819 | 819 | (uncaught-exception-handler
|
820 | 820 | (lambda (exn)
|
821 | 821 | (if (and (exn:break? exn) (send (get-tab) suspend-on-break?))
|
|
0 commit comments