Mercurial > emacs
comparison lisp/emacs-lisp/edebug.el @ 64222:ceb9ed49f7bb
(edebug-slow-after, edebug-slow-before): Do nothing if edebug-active.
(edebug-enter): Don't do with-timeout-suspend here.
(edebug-display): Do it here instead.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 11 Jul 2005 04:05:07 +0000 |
parents | 2cf2651a3a37 |
children | 3b29f20942e2 fbb2bea03df9 |
comparison
equal
deleted
inserted
replaced
64221:fab4526842b1 | 64222:ceb9ed49f7bb |
---|---|
2242 ;; Doing it here also keeps it from growing too large. | 2242 ;; Doing it here also keeps it from growing too large. |
2243 (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? | 2243 (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? |
2244 (max-specpdl-size (+ 200 max-specpdl-size)) | 2244 (max-specpdl-size (+ 200 max-specpdl-size)) |
2245 | 2245 |
2246 (debugger edebug-debugger) ; only while edebug is active. | 2246 (debugger edebug-debugger) ; only while edebug is active. |
2247 (edebug-with-timeout-suspend (with-timeout-suspend)) | |
2248 (edebug-outside-debug-on-error debug-on-error) | 2247 (edebug-outside-debug-on-error debug-on-error) |
2249 (edebug-outside-debug-on-quit debug-on-quit) | 2248 (edebug-outside-debug-on-quit debug-on-quit) |
2250 ;; Binding these may not be the right thing to do. | 2249 ;; Binding these may not be the right thing to do. |
2251 ;; We want to allow the global values to be changed. | 2250 ;; We want to allow the global values to be changed. |
2252 (debug-on-error (or debug-on-error edebug-on-error)) | 2251 (debug-on-error (or debug-on-error edebug-on-error)) |
2288 edebug-execution-mode) | 2287 edebug-execution-mode) |
2289 edebug-next-execution-mode nil) | 2288 edebug-next-execution-mode nil) |
2290 (edebug-enter edebug-function edebug-args edebug-body)) | 2289 (edebug-enter edebug-function edebug-args edebug-body)) |
2291 ;; Reset global variables in case outside value was changed. | 2290 ;; Reset global variables in case outside value was changed. |
2292 (setq executing-kbd-macro edebug-outside-executing-macro) | 2291 (setq executing-kbd-macro edebug-outside-executing-macro) |
2293 (with-timeout-unsuspend edebug-with-timeout-suspend) | |
2294 (edebug-restore-status | 2292 (edebug-restore-status |
2295 'post-command-hook edebug-outside-post-command-hook) | 2293 'post-command-hook edebug-outside-post-command-hook) |
2296 (edebug-restore-status | 2294 (edebug-restore-status |
2297 'pre-command-hook edebug-outside-pre-command-hook))) | 2295 'pre-command-hook edebug-outside-pre-command-hook))) |
2298 | 2296 |
2374 edebug-trace-buffer "%s} %s" (make-string edebug-stack-depth ?\:) msg)) | 2372 edebug-trace-buffer "%s} %s" (make-string edebug-stack-depth ?\:) msg)) |
2375 | 2373 |
2376 | 2374 |
2377 | 2375 |
2378 (defun edebug-slow-before (edebug-before-index) | 2376 (defun edebug-slow-before (edebug-before-index) |
2379 ;; Debug current function given BEFORE position. | 2377 (unless edebug-active |
2380 ;; Called from functions compiled with edebug-eval-top-level-form. | 2378 ;; Debug current function given BEFORE position. |
2381 ;; Return the before index. | 2379 ;; Called from functions compiled with edebug-eval-top-level-form. |
2382 (setcar edebug-offset-indices edebug-before-index) | 2380 ;; Return the before index. |
2383 | 2381 (setcar edebug-offset-indices edebug-before-index) |
2384 ;; Increment frequency count | 2382 |
2385 (aset edebug-freq-count edebug-before-index | 2383 ;; Increment frequency count |
2386 (1+ (aref edebug-freq-count edebug-before-index))) | 2384 (aset edebug-freq-count edebug-before-index |
2387 | 2385 (1+ (aref edebug-freq-count edebug-before-index))) |
2388 (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) | 2386 |
2389 (edebug-input-pending-p)) | 2387 (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) |
2390 (edebug-debugger edebug-before-index 'before nil)) | 2388 (edebug-input-pending-p)) |
2389 (edebug-debugger edebug-before-index 'before nil))) | |
2391 edebug-before-index) | 2390 edebug-before-index) |
2392 | 2391 |
2393 (defun edebug-fast-before (edebug-before-index) | 2392 (defun edebug-fast-before (edebug-before-index) |
2394 ;; Do nothing. | 2393 ;; Do nothing. |
2395 ) | 2394 ) |
2396 | 2395 |
2397 (defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value) | 2396 (defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value) |
2398 ;; Debug current function given AFTER position and VALUE. | 2397 (if edebug-active |
2399 ;; Called from functions compiled with edebug-eval-top-level-form. | |
2400 ;; Return VALUE. | |
2401 (setcar edebug-offset-indices edebug-after-index) | |
2402 | |
2403 ;; Increment frequency count | |
2404 (aset edebug-freq-count edebug-after-index | |
2405 (1+ (aref edebug-freq-count edebug-after-index))) | |
2406 (if edebug-test-coverage (edebug-update-coverage)) | |
2407 | |
2408 (if (and (eq edebug-execution-mode 'Go-nonstop) | |
2409 (not (edebug-input-pending-p))) | |
2410 ;; Just return result. | |
2411 edebug-value | 2398 edebug-value |
2412 (edebug-debugger edebug-after-index 'after edebug-value) | 2399 ;; Debug current function given AFTER position and VALUE. |
2413 )) | 2400 ;; Called from functions compiled with edebug-eval-top-level-form. |
2401 ;; Return VALUE. | |
2402 (setcar edebug-offset-indices edebug-after-index) | |
2403 | |
2404 ;; Increment frequency count | |
2405 (aset edebug-freq-count edebug-after-index | |
2406 (1+ (aref edebug-freq-count edebug-after-index))) | |
2407 (if edebug-test-coverage (edebug-update-coverage)) | |
2408 | |
2409 (if (and (eq edebug-execution-mode 'Go-nonstop) | |
2410 (not (edebug-input-pending-p))) | |
2411 ;; Just return result. | |
2412 edebug-value | |
2413 (edebug-debugger edebug-after-index 'after edebug-value) | |
2414 ))) | |
2414 | 2415 |
2415 (defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value) | 2416 (defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value) |
2416 ;; Do nothing but return the value. | 2417 ;; Do nothing but return the value. |
2417 edebug-value) | 2418 edebug-value) |
2418 | 2419 |
2533 (debug)) | 2534 (debug)) |
2534 ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. | 2535 ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. |
2535 ;; Uses local variables of edebug-enter, edebug-before, edebug-after | 2536 ;; Uses local variables of edebug-enter, edebug-before, edebug-after |
2536 ;; and edebug-debugger. | 2537 ;; and edebug-debugger. |
2537 (let ((edebug-active t) ; for minor mode alist | 2538 (let ((edebug-active t) ; for minor mode alist |
2539 (edebug-with-timeout-suspend (with-timeout-suspend)) | |
2538 edebug-stop ; should we enter recursive-edit | 2540 edebug-stop ; should we enter recursive-edit |
2539 (edebug-point (+ edebug-def-mark | 2541 (edebug-point (+ edebug-def-mark |
2540 (aref (nth 2 edebug-data) edebug-offset-index))) | 2542 (aref (nth 2 edebug-data) edebug-offset-index))) |
2541 edebug-buffer-outside-point ; current point in edebug-buffer | 2543 edebug-buffer-outside-point ; current point in edebug-buffer |
2542 ;; window displaying edebug-buffer | 2544 ;; window displaying edebug-buffer |
2759 (set-buffer edebug-buffer) | 2761 (set-buffer edebug-buffer) |
2760 (goto-char edebug-buffer-outside-point) | 2762 (goto-char edebug-buffer-outside-point) |
2761 (set-buffer current-buffer)) | 2763 (set-buffer current-buffer)) |
2762 ;; ... nothing more. | 2764 ;; ... nothing more. |
2763 ) | 2765 ) |
2766 (with-timeout-unsuspend edebug-with-timeout-suspend) | |
2764 ;; Reset global variables to outside values in case they were changed. | 2767 ;; Reset global variables to outside values in case they were changed. |
2765 (setq | 2768 (setq |
2766 overlay-arrow-position edebug-outside-o-a-p | 2769 overlay-arrow-position edebug-outside-o-a-p |
2767 overlay-arrow-string edebug-outside-o-a-s | 2770 overlay-arrow-string edebug-outside-o-a-s |
2768 cursor-in-echo-area edebug-outside-c-i-e-a) | 2771 cursor-in-echo-area edebug-outside-c-i-e-a) |