aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-02-06 15:36:41 +0000
committerRichard M. Stallman2002-02-06 15:36:41 +0000
commit27bde5f0d3758ad50ae5ae2ff1053d671a48468b (patch)
tree03da388bc3dae9ad89533ebf26517d174cf6acec
parent1c511be4d963f4882e9ff03d484be99260c355e4 (diff)
downloademacs-27bde5f0d3758ad50ae5ae2ff1053d671a48468b.tar.gz
emacs-27bde5f0d3758ad50ae5ae2ff1053d671a48468b.zip
(debugger-frame-offset): Var deleted.
(debugger-frame-number): Figure out the offset directly. (debugger-setup-buffer): Don't use debugger-frame-offset. (debugger-frame, debugger-frame-clear): Likewise. (debugger-jump): Don't alter debugger-frame-offset.
-rw-r--r--lisp/emacs-lisp/debug.el32
1 files changed, 12 insertions, 20 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 510cded57e4..a768d39b492 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -272,12 +272,13 @@ That buffer should be current already."
272 (cdr debugger-args) debugger-args) 272 (cdr debugger-args) debugger-args)
273 (current-buffer)) 273 (current-buffer))
274 (insert ?\n))) 274 (insert ?\n)))
275 (when (re-search-forward "^ eval-buffer(" nil t) 275 ;; After any frame that uses eval-buffer,
276 (end-of-line) 276 ;; insert a line that states the buffer position it's reading at.
277 (insert (format "\n ;;; Reading at buffer position %d" 277 (save-excursion
278 (let ((level (+ (debugger-frame-number) 278 (while (re-search-forward "^ eval-buffer(" nil t)
279 debugger-frame-offset -4))) 279 (end-of-line)
280 (with-current-buffer (nth 2 (backtrace-frame level)) 280 (insert (format "\n ;;; Reading at buffer position %d"
281 (with-current-buffer (nth 2 (backtrace-frame (debugger-frame-number)))
281 (point)))))) 282 (point))))))
282 (debugger-make-xrefs)) 283 (debugger-make-xrefs))
283 284
@@ -375,19 +376,10 @@ will be used, such as in a debug on exit from a frame."
375 (prin1 debugger-value) 376 (prin1 debugger-value)
376 (exit-recursive-edit)) 377 (exit-recursive-edit))
377 378
378;; Chosen empirically to account for all the frames
379;; that will exist when debugger-frame is called
380;; within the first one that appears in the backtrace buffer.
381;; Assumes debugger-frame is called from a key;
382;; will be wrong if it is called with Meta-x.
383(defconst debugger-frame-offset 8 "")
384
385(defun debugger-jump () 379(defun debugger-jump ()
386 "Continue to exit from this frame, with all debug-on-entry suspended." 380 "Continue to exit from this frame, with all debug-on-entry suspended."
387 (interactive) 381 (interactive)
388 ;; Compensate for the two extra stack frames for debugger-jump. 382 (debugger-frame)
389 (let ((debugger-frame-offset (+ debugger-frame-offset 2)))
390 (debugger-frame))
391 ;; Turn off all debug-on-entry functions 383 ;; Turn off all debug-on-entry functions
392 ;; but leave them in the list. 384 ;; but leave them in the list.
393 (let ((list debug-function-list)) 385 (let ((list debug-function-list))
@@ -414,6 +406,8 @@ will be used, such as in a debug on exit from a frame."
414 (beginning-of-line) 406 (beginning-of-line)
415 (let ((opoint (point)) 407 (let ((opoint (point))
416 (count 0)) 408 (count 0))
409 (while (not (eq (cadr (backtrace-frame count)) 'debug))
410 (setq count (1+ count)))
417 (goto-char (point-min)) 411 (goto-char (point-min))
418 (if (or (equal (buffer-substring (point) (+ (point) 6)) 412 (if (or (equal (buffer-substring (point) (+ (point) 6))
419 "Signal") 413 "Signal")
@@ -444,8 +438,7 @@ Applies to the frame whose line point is on in the backtrace."
444 (if (looking-at " *;;;\\|[a-z]") 438 (if (looking-at " *;;;\\|[a-z]")
445 (error "This line is not a function call"))) 439 (error "This line is not a function call")))
446 (beginning-of-line) 440 (beginning-of-line)
447 (let ((level (debugger-frame-number))) 441 (backtrace-debug (debugger-frame-number) t)
448 (backtrace-debug (+ level debugger-frame-offset) t))
449 (if (= (following-char) ? ) 442 (if (= (following-char) ? )
450 (let ((buffer-read-only nil)) 443 (let ((buffer-read-only nil))
451 (delete-char 1) 444 (delete-char 1)
@@ -461,8 +454,7 @@ Applies to the frame whose line point is on in the backtrace."
461 (if (looking-at " *;;;\\|[a-z]") 454 (if (looking-at " *;;;\\|[a-z]")
462 (error "This line is not a function call"))) 455 (error "This line is not a function call")))
463 (beginning-of-line) 456 (beginning-of-line)
464 (let ((level (debugger-frame-number))) 457 (backtrace-debug (debugger-frame-number) nil)
465 (backtrace-debug (+ level debugger-frame-offset) nil))
466 (if (= (following-char) ?*) 458 (if (= (following-char) ?*)
467 (let ((buffer-read-only nil)) 459 (let ((buffer-read-only nil))
468 (delete-char 1) 460 (delete-char 1)