diff options
| author | Lute Kamstra | 2005-03-13 20:54:14 +0000 |
|---|---|---|
| committer | Lute Kamstra | 2005-03-13 20:54:14 +0000 |
| commit | c4fbcb018256696aa38d2c76e3b414de19977c3b (patch) | |
| tree | 3929b83694f3cad5103c48a51f53a4cef05c8140 | |
| parent | bc8113ba7ba3d44a4864f47f571ed1f1081cae65 (diff) | |
| download | emacs-c4fbcb018256696aa38d2c76e3b414de19977c3b.tar.gz emacs-c4fbcb018256696aa38d2c76e3b414de19977c3b.zip | |
(debug): Set debug-on-exit before calling debugger-setup-buffer so
that backtrace marks the frames set to debug-on-exit and we don't have
to do it manually. Set an extra debug-on-exit for macro's.
(debugger-setup-buffer): Don't mark the top frame manually.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/emacs-lisp/debug.el | 28 |
2 files changed, 21 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8d82e2476bf..3dd1ae0dd0e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2005-03-13 Lute Kamstra <lute@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/debug.el (debug): Set debug-on-exit before calling | ||
| 4 | debugger-setup-buffer so that backtrace marks the frames set to | ||
| 5 | debug-on-exit and we don't have to do it manually. Set an extra | ||
| 6 | debug-on-exit for macro's. | ||
| 7 | (debugger-setup-buffer): Don't mark the top frame manually. | ||
| 8 | |||
| 1 | 2005-03-12 Lute Kamstra <lute@gnu.org> | 9 | 2005-03-12 Lute Kamstra <lute@gnu.org> |
| 2 | 10 | ||
| 3 | * emacs-lisp/byte-run.el: Replace lisp-indent-hook with | 11 | * emacs-lisp/byte-run.el: Replace lisp-indent-hook with |
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 668157fc52a..2be217a41c6 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el | |||
| @@ -170,7 +170,14 @@ first will be printed into the backtrace buffer." | |||
| 170 | (save-excursion | 170 | (save-excursion |
| 171 | (save-window-excursion | 171 | (save-window-excursion |
| 172 | (with-no-warnings | 172 | (with-no-warnings |
| 173 | (setq unread-command-char -1)) | 173 | (setq unread-command-char -1)) |
| 174 | (when (eq (car debugger-args) 'debug) | ||
| 175 | ;; Skip the frames for backtrace-debug, byte-code, | ||
| 176 | ;; and implement-debug-on-entry. | ||
| 177 | (backtrace-debug 4 t) | ||
| 178 | ;; Place an extra debug-on-exit for macro's. | ||
| 179 | (when (eq 'lambda (car-safe (cadr (backtrace-frame 4)))) | ||
| 180 | (backtrace-debug 5 t))) | ||
| 174 | (pop-to-buffer debugger-buffer) | 181 | (pop-to-buffer debugger-buffer) |
| 175 | (debugger-mode) | 182 | (debugger-mode) |
| 176 | (debugger-setup-buffer debugger-args) | 183 | (debugger-setup-buffer debugger-args) |
| @@ -190,10 +197,6 @@ first will be printed into the backtrace buffer." | |||
| 190 | (goto-char (point-min)) | 197 | (goto-char (point-min)) |
| 191 | (message "%s" (buffer-string)) | 198 | (message "%s" (buffer-string)) |
| 192 | (kill-emacs)) | 199 | (kill-emacs)) |
| 193 | (if (eq (car debugger-args) 'debug) | ||
| 194 | ;; Skip the frames for backtrace-debug, byte-code, | ||
| 195 | ;; and implement-debug-on-entry. | ||
| 196 | (backtrace-debug 4 t)) | ||
| 197 | (message "") | 200 | (message "") |
| 198 | (let ((standard-output nil) | 201 | (let ((standard-output nil) |
| 199 | (buffer-read-only t)) | 202 | (buffer-read-only t)) |
| @@ -225,7 +228,7 @@ first will be printed into the backtrace buffer." | |||
| 225 | (setq last-command debugger-outer-last-command) | 228 | (setq last-command debugger-outer-last-command) |
| 226 | (setq this-command debugger-outer-this-command) | 229 | (setq this-command debugger-outer-this-command) |
| 227 | (with-no-warnings | 230 | (with-no-warnings |
| 228 | (setq unread-command-char debugger-outer-unread-command-char)) | 231 | (setq unread-command-char debugger-outer-unread-command-char)) |
| 229 | (setq unread-command-events debugger-outer-unread-command-events) | 232 | (setq unread-command-events debugger-outer-unread-command-events) |
| 230 | (setq unread-post-input-method-events | 233 | (setq unread-post-input-method-events |
| 231 | debugger-outer-unread-post-input-method-events) | 234 | debugger-outer-unread-post-input-method-events) |
| @@ -263,12 +266,7 @@ That buffer should be current already." | |||
| 263 | ;; lambda is for debug-on-call when a function call is next. | 266 | ;; lambda is for debug-on-call when a function call is next. |
| 264 | ;; debug is for debug-on-entry function called. | 267 | ;; debug is for debug-on-entry function called. |
| 265 | (cond ((memq (car debugger-args) '(lambda debug)) | 268 | (cond ((memq (car debugger-args) '(lambda debug)) |
| 266 | (insert "--entering a function:\n") | 269 | (insert "--entering a function:\n")) |
| 267 | (if (eq (car debugger-args) 'debug) | ||
| 268 | (progn | ||
| 269 | (delete-char 1) | ||
| 270 | (insert ?*) | ||
| 271 | (beginning-of-line)))) | ||
| 272 | ;; Exiting a function. | 270 | ;; Exiting a function. |
| 273 | ((eq (car debugger-args) 'exit) | 271 | ((eq (car debugger-args) 'exit) |
| 274 | (insert "--returning value: ") | 272 | (insert "--returning value: ") |
| @@ -508,12 +506,12 @@ Applies to the frame whose line point is on in the backtrace." | |||
| 508 | (unwind-protect | 506 | (unwind-protect |
| 509 | (progn | 507 | (progn |
| 510 | (with-no-warnings | 508 | (with-no-warnings |
| 511 | (setq unread-command-char debugger-outer-unread-command-char)) | 509 | (setq unread-command-char debugger-outer-unread-command-char)) |
| 512 | (prog1 (progn ,@body) | 510 | (prog1 (progn ,@body) |
| 513 | (with-no-warnings | 511 | (with-no-warnings |
| 514 | (setq debugger-outer-unread-command-char unread-command-char)))) | 512 | (setq debugger-outer-unread-command-char unread-command-char)))) |
| 515 | (with-no-warnings | 513 | (with-no-warnings |
| 516 | (setq unread-command-char save-ucc)))) | 514 | (setq unread-command-char save-ucc)))) |
| 517 | (setq debugger-outer-match-data (match-data)) | 515 | (setq debugger-outer-match-data (match-data)) |
| 518 | (setq debugger-outer-load-read-function load-read-function) | 516 | (setq debugger-outer-load-read-function load-read-function) |
| 519 | (setq debugger-outer-overriding-terminal-local-map | 517 | (setq debugger-outer-overriding-terminal-local-map |