emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/gud.el [emacs-unicode-2]
Date: Mon, 28 Jun 2004 04:36:12 -0400

Index: emacs/lisp/progmodes/gud.el
diff -c emacs/lisp/progmodes/gud.el:1.4.2.1 emacs/lisp/progmodes/gud.el:1.4.2.2
*** emacs/lisp/progmodes/gud.el:1.4.2.1 Fri Apr 16 12:50:34 2004
--- emacs/lisp/progmodes/gud.el Mon Jun 28 07:29:43 2004
***************
*** 4,10 ****
  ;; Maintainer: FSF
  ;; Keywords: unix, tools
  
! ;; Copyright (C) 1992,93,94,95,96,1998,2000,02,2003 Free Software Foundation, 
Inc.
  
  ;; This file is part of GNU Emacs.
  
--- 4,10 ----
  ;; Maintainer: FSF
  ;; Keywords: unix, tools
  
! ;; Copyright (C) 1992,93,94,95,96,1998,2000,02,03,04 Free Software 
Foundation, Inc.
  
  ;; This file is part of GNU Emacs.
  
***************
*** 92,135 ****
  Used to grey out relevant toolbar icons.")
  
  (easy-mmode-defmap gud-menu-map
!   '(([refresh]        "Refresh" . gud-refresh)
      ([run]    menu-item "Run" gud-run
!                      :enable (and (not gud-running)
!                                 (memq gud-minor-mode '(gdba gdb dbx jdb))))
      ([until]  menu-item "Continue to selection" gud-until
!                      :enable (and (not gud-running)
!                                 (memq gud-minor-mode '(gdba gdb perldb))))
      ([remove] menu-item "Remove Breakpoint" gud-remove
!                      :enable (not gud-running))
      ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak
!                    :enable (memq gud-minor-mode '(gdba gdb sdb xdb bashdb)))
      ([break]  menu-item "Set Breakpoint" gud-break
!                      :enable (not gud-running))
      ([up]     menu-item "Up Stack" gud-up
!                    :enable (and (not gud-running)
!                                 (memq gud-minor-mode
!                                       '(gdba gdb dbx xdb jdb pdb bashdb))))
      ([down]   menu-item "Down Stack" gud-down
!                    :enable (and (not gud-running)
!                                 (memq gud-minor-mode
!                                       '(gdba gdb dbx xdb jdb pdb bashdb))))
      ([print]  menu-item "Print Expression" gud-print
                       :enable (not gud-running))
      ([watch]  menu-item "Watch Expression" gud-watch
                     :enable (and (not gud-running)
!                                 (eq gud-minor-mode 'gdba)))
      ([finish] menu-item "Finish Function" gud-finish
                     :enable (and (not gud-running)
                                  (memq gud-minor-mode
!                                       '(gdba gdb xdb jdb pdb bashdb))))
      ([stepi]  menu-item "Step Instruction" gud-stepi
                       :enable (and (not gud-running)
!                                 (memq gud-minor-mode
!                                       '(gdba gdb dbx))))
      ([nexti]  menu-item "Next Instruction" gud-nexti
                       :enable (and (not gud-running)
!                                 (memq gud-minor-mode
!                                       '(gdba gdb dbx))))
      ([step]   menu-item "Step Line" gud-step
                       :enable (not gud-running))
      ([next]   menu-item "Next Line" gud-next
--- 92,135 ----
  Used to grey out relevant toolbar icons.")
  
  (easy-mmode-defmap gud-menu-map
!   '(([help]     menu-item "Help" gdb-goto-info
!                   :enable (memq gud-minor-mode '(gdbmi gdba)))
!     ([refresh]        "Refresh" . gud-refresh)
      ([run]    menu-item "Run" gud-run
!                   :enable (and (not gud-running)
!                              (memq gud-minor-mode '(gdbmi gdba gdb dbx jdb))))
      ([until]  menu-item "Continue to selection" gud-until
!                   :enable (and (not gud-running)
!                              (memq gud-minor-mode '(gdbmi gdba gdb perldb))))
      ([remove] menu-item "Remove Breakpoint" gud-remove
!                   :enable (not gud-running))
      ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak
!                 :enable (memq gud-minor-mode '(gdbmi gdba gdb sdb xdb 
bashdb)))
      ([break]  menu-item "Set Breakpoint" gud-break
!                   :enable (not gud-running))
      ([up]     menu-item "Up Stack" gud-up
!                 :enable (and (not gud-running)
!                              (memq gud-minor-mode
!                                    '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))))
      ([down]   menu-item "Down Stack" gud-down
!                 :enable (and (not gud-running)
!                              (memq gud-minor-mode
!                                    '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))))
      ([print]  menu-item "Print Expression" gud-print
                       :enable (not gud-running))
      ([watch]  menu-item "Watch Expression" gud-watch
                     :enable (and (not gud-running)
!                                 (memq gud-minor-mode '(gdbmi gdba))))
      ([finish] menu-item "Finish Function" gud-finish
                     :enable (and (not gud-running)
                                  (memq gud-minor-mode
!                                       '(gdbmi gdba gdb xdb jdb pdb bashdb))))
      ([stepi]  menu-item "Step Instruction" gud-stepi
                       :enable (and (not gud-running)
!                                 (memq gud-minor-mode '(gdbmi gdba gdb dbx))))
      ([nexti]  menu-item "Next Instruction" gud-nexti
                       :enable (and (not gud-running)
!                                 (memq gud-minor-mode '(gdbmi gdba gdb dbx))))
      ([step]   menu-item "Step Line" gud-step
                       :enable (not gud-running))
      ([next]   menu-item "Next Line" gud-next
***************
*** 171,177 ****
                     (gud-stepi . "gud-si")
                     (gud-nexti . "gud-ni")
                     (gud-up . "gud-up")
!                    (gud-down . "gud-down"))
                   map)
          (tool-bar-local-item-from-menu
           (car x) (cdr x) map gud-minor-mode-map)))))
--- 171,178 ----
                     (gud-stepi . "gud-si")
                     (gud-nexti . "gud-ni")
                     (gud-up . "gud-up")
!                    (gud-down . "gud-down")
!                    (gdb-goto-info . "help"))
                   map)
          (tool-bar-local-item-from-menu
           (car x) (cdr x) map gud-minor-mode-map)))))
***************
*** 312,322 ****
  (defvar gud-speedbar-menu-items
    ;; Note to self.  Add expand, and turn off items when not available.
    '(["Jump to stack frame" speedbar-edit-line 
!      (with-current-buffer gud-comint-buffer (not (eq gud-minor-mode 'gdba)))]
      ["Edit value" speedbar-edit-line 
!      (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))]
      ["Delete expression" gdb-var-delete 
!      (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))])
    "Additional menu items to add to the speedbar frame.")
  
  ;; Make sure our special speedbar mode is loaded
--- 313,326 ----
  (defvar gud-speedbar-menu-items
    ;; Note to self.  Add expand, and turn off items when not available.
    '(["Jump to stack frame" speedbar-edit-line 
!      (with-current-buffer gud-comint-buffer
!        (not (memq gud-minor-mode '(gdbmi gdba))))]
      ["Edit value" speedbar-edit-line 
!      (with-current-buffer gud-comint-buffer
!        (not (memq gud-minor-mode '(gdbmi gdba))))]
      ["Delete expression" gdb-var-delete 
!      (with-current-buffer gud-comint-buffer
!        (not (memq gud-minor-mode '(gdbmi gdba))))])
    "Additional menu items to add to the speedbar frame.")
  
  ;; Make sure our special speedbar mode is loaded
***************
*** 330,336 ****
  off the specialized speedbar mode."
    (let ((minor-mode (with-current-buffer buffer gud-minor-mode)))
      (cond
!      ((eq minor-mode 'gdba)
        (when (or gdb-var-changed
                (not (save-excursion
                       (goto-char (point-min))
--- 334,340 ----
  off the specialized speedbar mode."
    (let ((minor-mode (with-current-buffer buffer gud-minor-mode)))
      (cond
!      ((memq minor-mode '(gdbmi gdba))
        (when (or gdb-var-changed
                (not (save-excursion
                       (goto-char (point-min))
***************
*** 397,403 ****
              (speedbar-insert-button (car frame)
                                      'speedbar-file-face
                                      'speedbar-highlight-face
!                                     (cond ((memq minor-mode '(gdba gdb))
                                             'gud-gdb-goto-stackframe)
                                            (t (error "Should never be here")))
                                        frame t)))
--- 401,407 ----
              (speedbar-insert-button (car frame)
                                      'speedbar-file-face
                                      'speedbar-highlight-face
!                                     (cond ((memq minor-mode '(gdbmi gdba gdb))
                                             'gud-gdb-goto-stackframe)
                                            (t (error "Should never be here")))
                                        frame t)))
***************
*** 1401,1407 ****
  
      output))
  
! (defcustom gud-pdb-command-name "pdb"
    "File name for executing the Python debugger.
  This should be an executable on your path, or an absolute file name."
    :type 'string
--- 1405,1411 ----
  
      output))
  
! (defcustom gud-pdb-command-name "pydb"
    "File name for executing the Python debugger.
  This should be an executable on your path, or an absolute file name."
    :type 'string
***************
*** 2339,2345 ****
    ;; Don't put repeated commands in command history many times.
    (set (make-local-variable 'comint-input-ignoredups) t)
    (make-local-variable 'paragraph-start)
!   (set (make-local-variable 'gud-delete-prompt-marker) (make-marker)))
  
  ;; Cause our buffers to be displayed, by default,
  ;; in the selected window.
--- 2343,2350 ----
    ;; Don't put repeated commands in command history many times.
    (set (make-local-variable 'comint-input-ignoredups) t)
    (make-local-variable 'paragraph-start)
!   (set (make-local-variable 'gud-delete-prompt-marker) (make-marker))
!   (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook nil t))
  
  ;; Cause our buffers to be displayed, by default,
  ;; in the selected window.
***************
*** 2384,2391 ****
                    (if (file-name-directory file-subst)
                        (expand-file-name file-subst)
                      file-subst)))
!        (filepart (and file-word (concat "-" (file-name-nondirectory file)))))
      (pop-to-buffer (concat "*gud" filepart "*"))
      ;; Set the dir, in case the buffer already existed with a different dir.
      (setq default-directory dir)
      ;; Set default-directory to the file's directory.
--- 2389,2399 ----
                    (if (file-name-directory file-subst)
                        (expand-file-name file-subst)
                      file-subst)))
!        (filepart (and file-word (concat "-" (file-name-nondirectory file))))
!        (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
      (pop-to-buffer (concat "*gud" filepart "*"))
+     (when (and existing-buffer (get-buffer-process existing-buffer))
+       (error "This program is already running under gdb"))
      ;; Set the dir, in case the buffer already existed with a different dir.
      (setq default-directory dir)
      ;; Set default-directory to the file's directory.
***************
*** 2507,2520 ****
         ;; Stop displaying an arrow in a source file.
         (setq overlay-arrow-position nil)
         (set-process-buffer proc nil)
!        (if (eq gud-minor-mode-type 'gdba)
             (gdb-reset)
           (gud-reset)))
        ((memq (process-status proc) '(signal exit))
         ;; Stop displaying an arrow in a source file.
         (setq overlay-arrow-position nil)
         (with-current-buffer gud-comint-buffer
!          (if (eq gud-minor-mode 'gdba)
               (gdb-reset)
             (gud-reset)))
         (let* ((obuf (current-buffer)))
--- 2515,2528 ----
         ;; Stop displaying an arrow in a source file.
         (setq overlay-arrow-position nil)
         (set-process-buffer proc nil)
!        (if (memq gud-minor-mode-type '(gdbmi gdba))
             (gdb-reset)
           (gud-reset)))
        ((memq (process-status proc) '(signal exit))
         ;; Stop displaying an arrow in a source file.
         (setq overlay-arrow-position nil)
         (with-current-buffer gud-comint-buffer
!          (if (memq gud-minor-mode-type '(gdbmi gdba))
               (gdb-reset)
             (gud-reset)))
         (let* ((obuf (current-buffer)))
***************
*** 2543,2561 ****
             (set-buffer obuf))))))
  
  (defun gud-kill-buffer-hook ()
!   (if gud-minor-mode
!       (setq gud-minor-mode-type gud-minor-mode)))
! 
! (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook)
  
  (defun gud-reset ()
    (dolist (buffer (buffer-list))
!     (if (not (eq buffer gud-comint-buffer))
!       (save-excursion
!         (set-buffer buffer)
!         (when gud-minor-mode
!           (setq gud-minor-mode nil)
!           (kill-local-variable 'tool-bar-map))))))
  
  (defun gud-display-frame ()
    "Find and obey the last filename-and-line marker from the debugger.
--- 2551,2568 ----
             (set-buffer obuf))))))
  
  (defun gud-kill-buffer-hook ()
!   (setq gud-minor-mode-type gud-minor-mode)
!   (condition-case nil
!       (kill-process (get-buffer-process gud-comint-buffer))
!     (error nil)))
  
  (defun gud-reset ()
    (dolist (buffer (buffer-list))
!     (unless (eq buffer gud-comint-buffer)
!       (with-current-buffer buffer
!       (when gud-minor-mode
!         (setq gud-minor-mode nil)
!         (kill-local-variable 'tool-bar-map))))))
  
  (defun gud-display-frame ()
    "Find and obey the last filename-and-line marker from the debugger.
***************
*** 2580,2586 ****
          (with-current-buffer gud-comint-buffer
            (gud-find-file true-file)))
         (window (and buffer (or (get-buffer-window buffer)
!                                (if (eq gud-minor-mode 'gdba)
                                     (gdb-display-source-buffer buffer)
                                   (display-buffer buffer)))))
         (pos))
--- 2587,2593 ----
          (with-current-buffer gud-comint-buffer
            (gud-find-file true-file)))
         (window (and buffer (or (get-buffer-window buffer)
!                                (if (memq gud-minor-mode '(gdbmi gdba))
                                     (gdb-display-source-buffer buffer)
                                   (display-buffer buffer)))))
         (pos))
***************
*** 2704,2710 ****
        (forward-line 0)
        (if (looking-at comint-prompt-regexp)
            (set-marker gud-delete-prompt-marker (point)))
!       (if (eq gud-minor-mode 'gdba)
            (apply comint-input-sender (list proc command))
          (process-send-string proc (concat command "\n")))))))
  
--- 2711,2717 ----
        (forward-line 0)
        (if (looking-at comint-prompt-regexp)
            (set-marker gud-delete-prompt-marker (point)))
!       (if (memq gud-minor-mode '(gdbmi gdba))
            (apply comint-input-sender (list proc command))
          (process-send-string proc (concat command "\n")))))))
  




reply via email to

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