;; Maintainer: FSF
;; Keywords: unix, tools
-;; Copyright (C) 1992,93,94,95,96,1998,2000,02,2003 Free Software Foundation, Inc.
+;; Copyright (C) 1992,93,94,95,96,1998,2000,02,03,04 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
Used to grey out relevant toolbar icons.")
(easy-mmode-defmap gud-menu-map
- '(([refresh] "Refresh" . gud-refresh)
+ '(([help] menu-item "Help" gdb-goto-info
+ :enable (eq gud-minor-mode 'gdba))
+ ([refresh] "Refresh" . gud-refresh)
([run] menu-item "Run" gud-run
:enable (and (not gud-running)
(memq gud-minor-mode '(gdba gdb dbx jdb))))
([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)))
+ :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))))
+ (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))))
+ (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
(gud-stepi . "gud-si")
(gud-nexti . "gud-ni")
(gud-up . "gud-up")
- (gud-down . "gud-down"))
+ (gud-down . "gud-down")
+ (gdb-goto-info . "help"))
map)
(tool-bar-local-item-from-menu
(car x) (cdr x) map gud-minor-mode-map)))))
(define-key gud-speedbar-key-map "j" 'speedbar-edit-line)
(define-key gud-speedbar-key-map "e" 'speedbar-edit-line)
- (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line)))
+ (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line)
+ (define-key gud-speedbar-key-map "D" 'gdb-var-delete)))
+
(defvar gud-speedbar-menu-items
;; Note to self. Add expand, and turn off items when not available.
- '(["Jump to stack frame" speedbar-edit-line t])
+ '(["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
(speedbar-make-tag-line 'bracket char
'gdb-speedbar-expand-node varnum
(concat (car var) "\t" (nth 3 var))
- 'gdb-var-delete
- nil nil depth)))
+ nil nil nil depth)))
(setq var-list (cdr var-list))))
(setq gdb-var-changed nil)))
(t (if (and (save-excursion
;; Set the accumulator to the remaining text.
gud-marker-acc (substring gud-marker-acc (match-end 0))))
+ ;; Check for annotations and change gud-minor-mode to 'gdba if
+ ;; they are found.
(while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
(when (string-equal (match-string 1 gud-marker-acc) "prompt")
(require 'gdb-ui)
(gdb-prompt nil))
+
(setq
;; Append any text before the marker to the output we're going
;; to return - we don't include the marker in this text.
;; gud-marker-acc until we receive the rest of it. Since we
;; know the full marker regexp above failed, it's pretty simple to
;; test for marker starts.
- (if (string-match "\032.*\\'" gud-marker-acc)
+ (if (string-match "\n\\(\032.*\\)?\\'" gud-marker-acc)
(progn
;; Everything before the potential marker start can be output.
(setq output (concat output (substring gud-marker-acc
gud-minibuffer-local-map nil
hist-sym)))
-(defvar gdb-first-pre-prompt t)
+(defvar gdb-first-prompt t)
;;;###autoload
(defun gdb (command-line)
(local-set-key "\C-i" 'gud-gdb-complete-command)
(setq comint-prompt-regexp "^(.*gdb[+]?) *")
(setq paragraph-start comint-prompt-regexp)
- (setq gdb-first-pre-prompt t)
+ (setq gdb-first-prompt t)
(run-hooks 'gdb-mode-hook))
;; One of the nice features of GDB is its impressive support for
output))
-(defcustom gud-pdb-command-name "pdb"
+(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
;; FIXME: Java ID's are UNICODE strings, this matches ASCII
;; ID's only.
;;
- ;; The "," in the last square-bracket is necessary because of
- ;; Sun's total disrespect for backwards compatibility in
+ ;; The ".," in the last square-bracket are necessary because
+ ;; of Sun's total disrespect for backwards compatibility in
;; reported line numbers from jdb - starting in 1.4.0 they
- ;; introduced a comma at the thousands position (how
- ;; ingenious!)
+ ;; print line numbers using LOCALE, inserting a comma or a
+ ;; period at the thousands positions (how ingenious!).
"\\(\[[0-9]+\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \
-\\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9,]+\\)"
+\\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)"
gud-marker-acc)
;; A good marker is one that:
(string-to-int
(let
((numstr (match-string 4 gud-marker-acc)))
- (if (string-match "," numstr)
+ (if (string-match "[.,]" numstr)
(replace-match "" nil nil numstr)
numstr)))))
(message "Could not find source file.")))
(if (file-name-directory file-subst)
(expand-file-name file-subst)
file-subst)))
- (filepart (and file-word (concat "-" (file-name-nondirectory file)))))
+ (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.