emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gud.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/gud.el
Date: Thu, 12 Sep 2002 17:26:28 -0400

Index: emacs/lisp/gud.el
diff -c emacs/lisp/gud.el:1.158 emacs/lisp/gud.el:1.159
*** emacs/lisp/gud.el:1.158     Wed Sep 11 01:07:25 2002
--- emacs/lisp/gud.el   Thu Sep 12 17:26:27 2002
***************
*** 214,220 ****
  
  ;; ======================================================================
  ;; speedbar support functions and variables.
! (eval-when-compile (require 'speedbar))
  
  (defvar gud-last-speedbar-buffer nil
    "The last GUD buffer used.")
--- 214,220 ----
  
  ;; ======================================================================
  ;; speedbar support functions and variables.
! (eval-when-compile (require 'speedbar))       ;For 
speedbar-with-attached-buffer.
  
  (defvar gud-last-speedbar-buffer nil
    "The last GUD buffer used.")
***************
*** 303,313 ****
  ;; ======================================================================
  ;; gdb functions
  
! ;;; History of argument lists passed to gdb.
  (defvar gud-gdb-history nil)
  
! (defun gud-gdb-massage-args (file args)
!   args)
  
  (defvar gud-gdb-marker-regexp
    ;; This used to use path-separator instead of ":";
--- 303,315 ----
  ;; ======================================================================
  ;; gdb functions
  
! ;; History of argument lists passed to gdb.
  (defvar gud-gdb-history nil)
  
! (defcustom gud-gdb-command-name "gdb --fullname"
!   "Default command to execute an executable under the GDB debugger."
!    :type 'string
!    :group 'gud)
  
  (defvar gud-gdb-marker-regexp
    ;; This used to use path-separator instead of ":";
***************
*** 383,389 ****
      (read-from-minibuffer
       (format "Run %s (like this): " minor-mode)
       (or (car-safe (symbol-value hist-sym))
!        (concat (or cmd-name (symbol-name minor-mode)) " --fullname " init))
       gud-minibuffer-local-map nil
       hist-sym)))
  
--- 385,400 ----
      (read-from-minibuffer
       (format "Run %s (like this): " minor-mode)
       (or (car-safe (symbol-value hist-sym))
!        (concat (or cmd-name (symbol-name minor-mode))
!                " "
!                (or init
!                    (let ((file nil))
!                      (dolist (f (directory-files default-directory) file)
!                        (if (and (file-executable-p f)
!                                 (not (file-directory-p f))
!                                 (or (not file)
!                                     (file-newer-than-file-p f file)))
!                            (setq file f)))))))
       gud-minibuffer-local-map nil
       hist-sym)))
  
***************
*** 394,400 ****
  and source-file directory for your debugger."
    (interactive (list (gud-query-cmdline 'gdb)))
  
!   (gud-common-init command-line 'gud-gdb-massage-args
                   'gud-gdb-marker-filter 'gud-gdb-find-file)
    (set (make-local-variable 'gud-minor-mode) 'gdb)
  
--- 405,411 ----
  and source-file directory for your debugger."
    (interactive (list (gud-query-cmdline 'gdb)))
  
!   (gud-common-init command-line nil
                   'gud-gdb-marker-filter 'gud-gdb-find-file)
    (set (make-local-variable 'gud-minor-mode) 'gdb)
  
***************
*** 621,627 ****
  ;; ======================================================================
  ;; sdb functions
  
! ;;; History of argument lists passed to sdb.
  (defvar gud-sdb-history nil)
  
  (defvar gud-sdb-needs-tags (not (file-exists-p "/var"))
--- 632,638 ----
  ;; ======================================================================
  ;; sdb functions
  
! ;; History of argument lists passed to sdb.
  (defvar gud-sdb-history nil)
  
  (defvar gud-sdb-needs-tags (not (file-exists-p "/var"))
***************
*** 629,636 ****
  
  (defvar gud-sdb-lastfile nil)
  
- (defun gud-sdb-massage-args (file args) args)
- 
  (defun gud-sdb-marker-filter (string)
    (setq gud-marker-acc
        (if gud-marker-acc (concat gud-marker-acc string) string))
--- 640,645 ----
***************
*** 696,702 ****
                     (file-exists-p tags-file-name))))
        (error "The sdb support requires a valid tags table to work"))
  
!   (gud-common-init command-line 'gud-sdb-massage-args
                   'gud-sdb-marker-filter 'gud-sdb-find-file)
    (set (make-local-variable 'gud-minor-mode) 'sdb)
  
--- 705,711 ----
                     (file-exists-p tags-file-name))))
        (error "The sdb support requires a valid tags table to work"))
  
!   (gud-common-init command-line nil
                   'gud-sdb-marker-filter 'gud-sdb-find-file)
    (set (make-local-variable 'gud-minor-mode) 'sdb)
  
***************
*** 719,725 ****
  ;; ======================================================================
  ;; dbx functions
  
! ;;; History of argument lists passed to dbx.
  (defvar gud-dbx-history nil)
  
  (defcustom gud-dbx-directories nil
--- 728,734 ----
  ;; ======================================================================
  ;; dbx functions
  
! ;; History of argument lists passed to dbx.
  (defvar gud-dbx-history nil)
  
  (defcustom gud-dbx-directories nil
***************
*** 1074,1080 ****
  ;; ======================================================================
  ;; xdb (HP PARISC debugger) functions
  
! ;;; History of argument lists passed to xdb.
  (defvar gud-xdb-history nil)
  
  (defcustom gud-xdb-directories nil
--- 1083,1089 ----
  ;; ======================================================================
  ;; xdb (HP PARISC debugger) functions
  
! ;; History of argument lists passed to xdb.
  (defvar gud-xdb-history nil)
  
  (defcustom gud-xdb-directories nil
***************
*** 1125,1134 ****
                              result)
                (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):"
                              result))
!           (let ((line (string-to-int
!                        (substring result (match-beginning 2) (match-end 2))))
!                 (file (gud-xdb-file-name
!                        (substring result (match-beginning 1) (match-end 1)))))
              (if file
                  (setq gud-last-frame (cons file line))))))
      (or result "")))
--- 1134,1141 ----
                              result)
                (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):"
                              result))
!           (let ((line (string-to-int (match-string 2 result)))
!                 (file (gud-xdb-file-name (match-string 1 result))))
              (if file
                  (setq gud-last-frame (cons file line))))))
      (or result "")))
***************
*** 1176,1194 ****
  ;; ======================================================================
  ;; perldb functions
  
! ;;; History of argument lists passed to perldb.
  (defvar gud-perldb-history nil)
  
- ;; Convert a command line as would be typed normally to run a script
- ;; into one that invokes an Emacs-enabled debugging session.
- ;; "-d" in inserted as the first switch, and "-emacs" is inserted where
- ;; it will be $ARGV[0] (see perl5db.pl).
  (defun gud-perldb-massage-args (file args)
!   (let* ((new-args (list "-d"))
         (seen-e nil)
!        (shift (lambda ()
!                 (setq new-args (cons (car args) new-args))
!                 (setq args (cdr args)))))
  
      ;; Pass all switches and -e scripts through.
      (while (and args
--- 1183,1200 ----
  ;; ======================================================================
  ;; perldb functions
  
! ;; History of argument lists passed to perldb.
  (defvar gud-perldb-history nil)
  
  (defun gud-perldb-massage-args (file args)
!   "Convert a command line as would be typed normally to run perldb
! into one that invokes an Emacs-enabled debugging session.
! \"-emacs\" is inserted where it will be $ARGV[0] (see perl5db.pl)."
!   ;; FIXME: what if the command is `make perldb' and doesn't accept those 
extra
!   ;; arguments ?
!   (let* ((new-args nil)
         (seen-e nil)
!        (shift (lambda () (push (pop args) new-args))))
  
      ;; Pass all switches and -e scripts through.
      (while (and args
***************
*** 1275,1282 ****
  (defun gud-perldb-find-file (f)
    (find-file-noselect f))
  
! (defcustom gud-perldb-command-name "perl"
!   "File name for executing Perl."
    :type 'string
    :group 'gud)
  
--- 1281,1288 ----
  (defun gud-perldb-find-file (f)
    (find-file-noselect f))
  
! (defcustom gud-perldb-command-name "perl -d"
!   "Default command to execute a Perl script under debugger."
    :type 'string
    :group 'gud)
  
***************
*** 1310,1321 ****
  ;; ======================================================================
  ;; pdb (Python debugger) functions
  
! ;;; History of argument lists passed to pdb.
  (defvar gud-pdb-history nil)
  
- (defun gud-pdb-massage-args (file args)
-   args)
- 
  ;; Last group is for return value, e.g. "> test.py(2)foo()->None"
  ;; Either file or function name may be omitted: "> <string>(0)?()"
  (defvar gud-pdb-marker-regexp
--- 1316,1324 ----
  ;; ======================================================================
  ;; pdb (Python debugger) functions
  
! ;; History of argument lists passed to pdb.
  (defvar gud-pdb-history nil)
  
  ;; Last group is for return value, e.g. "> test.py(2)foo()->None"
  ;; Either file or function name may be omitted: "> <string>(0)?()"
  (defvar gud-pdb-marker-regexp
***************
*** 1398,1404 ****
    (interactive
     (list (gud-query-cmdline 'pdb)))
  
!   (gud-common-init command-line 'gud-pdb-massage-args
                   'gud-pdb-marker-filter 'gud-pdb-find-file)
    (set (make-local-variable 'gud-minor-mode) 'pdb)
  
--- 1401,1407 ----
    (interactive
     (list (gud-query-cmdline 'pdb)))
  
!   (gud-common-init command-line nil
                   'gud-pdb-marker-filter 'gud-pdb-find-file)
    (set (make-local-variable 'gud-minor-mode) 'pdb)
  
***************
*** 1536,1542 ****
   "Java/jdb classpath directories list.
  If `gud-jdb-use-classpath' is non-nil, gud-jdb derives the `gud-jdb-classpath'
  list automatically using the following methods in sequence
! (with subsequent successful steps overriding the results of previous
  steps):
  
  1) Read the CLASSPATH environment variable,
--- 1539,1545 ----
   "Java/jdb classpath directories list.
  If `gud-jdb-use-classpath' is non-nil, gud-jdb derives the `gud-jdb-classpath'
  list automatically using the following methods in sequence
! \(with subsequent successful steps overriding the results of previous
  steps):
  
  1) Read the CLASSPATH environment variable,
***************
*** 2103,2148 ****
  ;;
  
  
! ;;; When we send a command to the debugger via gud-call, it's annoying
! ;;; to see the command and the new prompt inserted into the debugger's
! ;;; buffer; we have other ways of knowing the command has completed.
! ;;;
! ;;; If the buffer looks like this:
! ;;; --------------------
! ;;; (gdb) set args foo bar
! ;;; (gdb) -!-
! ;;; --------------------
! ;;; (the -!- marks the location of point), and we type `C-x SPC' in a
! ;;; source file to set a breakpoint, we want the buffer to end up like
! ;;; this:
! ;;; --------------------
! ;;; (gdb) set args foo bar
! ;;; Breakpoint 1 at 0x92: file make-docfile.c, line 49.
! ;;; (gdb) -!-
! ;;; --------------------
! ;;; Essentially, the old prompt is deleted, and the command's output
! ;;; and the new prompt take its place.
! ;;;
! ;;; Not echoing the command is easy enough; you send it directly using
! ;;; process-send-string, and it never enters the buffer.  However,
! ;;; getting rid of the old prompt is trickier; you don't want to do it
! ;;; when you send the command, since that will result in an annoying
! ;;; flicker as the prompt is deleted, redisplay occurs while Emacs
! ;;; waits for a response from the debugger, and the new prompt is
! ;;; inserted.  Instead, we'll wait until we actually get some output
! ;;; from the subprocess before we delete the prompt.  If the command
! ;;; produced no output other than a new prompt, that prompt will most
! ;;; likely be in the first chunk of output received, so we will delete
! ;;; the prompt and then replace it with an identical one.  If the
! ;;; command produces output, the prompt is moving anyway, so the
! ;;; flicker won't be annoying.
! ;;;
! ;;; So - when we want to delete the prompt upon receipt of the next
! ;;; chunk of debugger output, we position gud-delete-prompt-marker at
! ;;; the start of the prompt; the process filter will notice this, and
! ;;; delete all text between it and the process output marker.  If
! ;;; gud-delete-prompt-marker points nowhere, we leave the current
! ;;; prompt alone.
  (defvar gud-delete-prompt-marker nil)
  
  
--- 2106,2151 ----
  ;;
  
  
! ;; When we send a command to the debugger via gud-call, it's annoying
! ;; to see the command and the new prompt inserted into the debugger's
! ;; buffer; we have other ways of knowing the command has completed.
! ;;
! ;; If the buffer looks like this:
! ;; --------------------
! ;; (gdb) set args foo bar
! ;; (gdb) -!-
! ;; --------------------
! ;; (the -!- marks the location of point), and we type `C-x SPC' in a
! ;; source file to set a breakpoint, we want the buffer to end up like
! ;; this:
! ;; --------------------
! ;; (gdb) set args foo bar
! ;; Breakpoint 1 at 0x92: file make-docfile.c, line 49.
! ;; (gdb) -!-
! ;; --------------------
! ;; Essentially, the old prompt is deleted, and the command's output
! ;; and the new prompt take its place.
! ;;
! ;; Not echoing the command is easy enough; you send it directly using
! ;; process-send-string, and it never enters the buffer.  However,
! ;; getting rid of the old prompt is trickier; you don't want to do it
! ;; when you send the command, since that will result in an annoying
! ;; flicker as the prompt is deleted, redisplay occurs while Emacs
! ;; waits for a response from the debugger, and the new prompt is
! ;; inserted.  Instead, we'll wait until we actually get some output
! ;; from the subprocess before we delete the prompt.  If the command
! ;; produced no output other than a new prompt, that prompt will most
! ;; likely be in the first chunk of output received, so we will delete
! ;; the prompt and then replace it with an identical one.  If the
! ;; command produces output, the prompt is moving anyway, so the
! ;; flicker won't be annoying.
! ;;
! ;; So - when we want to delete the prompt upon receipt of the next
! ;; chunk of debugger output, we position gud-delete-prompt-marker at
! ;; the start of the prompt; the process filter will notice this, and
! ;; delete all text between it and the process output marker.  If
! ;; gud-delete-prompt-marker points nowhere, we leave the current
! ;; prompt alone.
  (defvar gud-delete-prompt-marker nil)
  
  
***************
*** 2270,2276 ****
        (if w
          (setcar w file)))
      (apply 'make-comint (concat "gud" filepart) program nil
!          (funcall massage-args file args)))
    ;; Since comint clobbered the mode, we don't set it until now.
    (gud-mode)
    (make-local-variable 'gud-marker-filter)
--- 2273,2279 ----
        (if w
          (setcar w file)))
      (apply 'make-comint (concat "gud" filepart) program nil
!          (if massage-args (funcall massage-args file args) args)))
    ;; Since comint clobbered the mode, we don't set it until now.
    (gud-mode)
    (make-local-variable 'gud-marker-filter)
***************
*** 2438,2447 ****
                   (goto-char pos))))
          (set-window-point window overlay-arrow-position)))))
  
! ;;; The gud-call function must do the right thing whether its invoking
! ;;; keystroke is from the GUD buffer itself (via major-mode binding)
! ;;; or a C buffer.  In the former case, we want to supply data from
! ;;; gud-last-frame.  Here's how we do it:
  
  (defun gud-format-command (str arg)
    (let ((insource (not (eq (current-buffer) gud-comint-buffer)))
--- 2441,2450 ----
                   (goto-char pos))))
          (set-window-point window overlay-arrow-position)))))
  
! ;; The gud-call function must do the right thing whether its invoking
! ;; keystroke is from the GUD buffer itself (via major-mode binding)
! ;; or a C buffer.  In the former case, we want to supply data from
! ;; gud-last-frame.  Here's how we do it:
  
  (defun gud-format-command (str arg)
    (let ((insource (not (eq (current-buffer) gud-comint-buffer)))
***************
*** 2469,2475 ****
                       (if insource
                           (save-restriction
                             (widen)
!                            (+ (count-lines 1 (point))
                                (if (bolp) 1 0)))
                         (cdr frame)))))
         ((eq key ?e)
--- 2472,2478 ----
                       (if insource
                           (save-restriction
                             (widen)
!                            (+ (count-lines (point-min) (point))
                                (if (bolp) 1 0)))
                         (cdr frame)))))
         ((eq key ?e)
***************
*** 2537,2548 ****
    (gud-display-frame)
    (recenter arg))
  
! ;;; Code for parsing expressions out of C code.        The single entry point 
is
! ;;; find-c-expr, which tries to return an lvalue expression from around point.
! ;;;
! ;;; The rest of this file is a hacked version of gdbsrc.el by
! ;;; Debby Ayers <address@hidden>,
! ;;; Rich Schaefer <address@hidden> Schlumberger, Austin, Tx.
  
  (defun gud-find-c-expr ()
    "Returns the C expr that surrounds point."
--- 2540,2551 ----
    (gud-display-frame)
    (recenter arg))
  
! ;; Code for parsing expressions out of C code.  The single entry point is
! ;; find-c-expr, which tries to return an lvalue expression from around point.
! ;;
! ;; The rest of this file is a hacked version of gdbsrc.el by
! ;; Debby Ayers <address@hidden>,
! ;; Rich Schaefer <address@hidden> Schlumberger, Austin, Tx.
  
  (defun gud-find-c-expr ()
    "Returns the C expr that surrounds point."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]