+2002-12-04 Stefan Monnier <monnier@cs.yale.edu>
+
+ * gdb-ui.el (gdb-inferior-io-mode-map): Remove (unused).
+ (gdb-inferior-io-mode): Use define-minor-mode.
+ (gdb-source-info): Don't burp if there's no source file.
+ (gdb-inferior-io-interrupt, gdb-inferior-io-quit)
+ (gdb-inferior-io-stop, gdb-inferior-io-eof)
+ (gdb-display-breakpoints-buffer, gdb-frame-breakpoints-buffer)
+ (gdb-display-stack-buffer, gdb-frame-stack-buffer)
+ (gdb-display-registers-buffer, gdb-frame-registers-buffer)
+ (gdb-display-locals-buffer, gdb-frame-locals-buffer)
+ (gdb-display-display-buffer, gdb-frame-display-buffer)
+ (gdb-display-gdb-buffer, gdb-frame-gdb-buffer)
+ (gdb-display-assembler-buffer, gdb-frame-assembler-buffer):
+ Remove the spurious left over arg from the "big reorg".
+
2002-12-04 Richard M. Stallman <rms@gnu.org>
* gud.el (gud-menu-map): Delete CVS conflict markers.
* tooltip.el (tooltip-gud-tips-p): Undo previous change.
+2002-12-03 Stefan Monnier <monnier@cs.yale.edu>
+
+ * gdb-ui.el: Get rid of (quote ..); use match-string and ignore.
+
+ * gdb-ui.el (gdba, gdb-starting, gdb-stopped, gdb-quit):
+ Update gdb-running -> gud-running.
+ (gdba): Use the default for gud-find-file.
+ (def-gdb-variable): Remove: fold into def-gdb-var.
+ (def-gdb-var): Use buffer-local-value and with-current-buffer.
+
+ * gud.el (gud-running): Rename from gdb-running. Update uses.
+ (gud-tool-bar-map): Use tool-bar-local-item-from-menu rather than
+ tool-bar-add-item-from-menu to avoid let binding tool-bar-map
+ which fails if tool-bar.el is loaded in the mean time.
+ (gud-file-name): New fun.
+ (gud-find-file): Use it as default value for gud-find-file.
+ (gud-speedbar-buttons): Discriminate on gud-minor-mode rather than
+ on gud-find-file.
+ (gud-gdb-find-file, gud-dbx-file-name, gud-dbx-find-file)
+ (gud-xdb-file-name, gud-xdb-find-file, gud-perldb-find-file)
+ (gud-pdb-find-file, gud-jdb-find-file): Remove.
+ (gud-query-cmdline): Don't stuff the whole cwd in the command.
+ (gdb, dbx, xdb, perldb, pdb, jdb): Use the default for gud-find-file.
+ (gud-mipsdbx-massage-args): Remove.
+ (gud-dbx-command-name): New var. Do what gud-mipsdbx-massage-args did.
+ (gud-irixdbx-marker-filter): Use match-string and gud-file-name.
+ (gud-jdb-command-name): New var.
+ (gud-common-init): Re-instate RMS code of 11/13.
+
2002-12-03 Dave Love <fx@gnu.org>
* international/ucs-tables.el (ucs-unify-8859, ucs-unify-8859)
(gdb-instance-target-string)
"*"))
-(defvar gdb-inferior-io-mode-map (copy-keymap comint-mode-map))
(define-key comint-mode-map "\C-c\C-c" 'gdb-inferior-io-interrupt)
(define-key comint-mode-map "\C-c\C-z" 'gdb-inferior-io-stop)
(define-key comint-mode-map "\C-c\C-\\" 'gdb-inferior-io-quit)
(define-key comint-mode-map "\C-c\C-d" 'gdb-inferior-io-eof)
-(defun gdb-inferior-io-mode ()
- "Major mode for gdb inferior-io.
-
-\\{comint-mode-map}"
+(define-derived-mode gdb-inferior-io-mode comint-mode "Debuggee I/O"
+ "Major mode for gdb inferior-io."
+ :syntax-table nil :abbrev-table nil
;; We want to use comint because it has various nifty and familiar
;; features. We don't need a process, but comint wants one, so create
;; a dummy one.
- (make-comint (substring (buffer-name) 1 (- (length (buffer-name)) 1))
- "/bin/cat")
- (setq major-mode 'gdb-inferior-io-mode)
- (setq mode-name "Debuggee I/O")
+ (make-comint-in-buffer
+ (substring (buffer-name) 1 (- (length (buffer-name)) 1))
+ (current-buffer) "/bin/cat")
(set (make-local-variable 'gud-minor-mode) 'gdba)
(set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
(setq comint-input-sender 'gdb-inferior-io-sender))
(defun gdb-inferior-io-interrupt ()
"Interrupt the program being debugged."
- (interactive (list gdb-proc))
+ (interactive)
(interrupt-process
(get-buffer-process (gdb-get-instance-buffer 'gdba)) comint-ptyp))
(defun gdb-inferior-io-quit ()
"Send quit signal to the program being debugged."
- (interactive (list gdb-proc))
+ (interactive)
(quit-process
(get-buffer-process (gdb-get-instance-buffer 'gdba)) comint-ptyp))
(defun gdb-inferior-io-stop ()
"Stop the program being debugged."
- (interactive (list gdb-proc))
+ (interactive)
(stop-process
(get-buffer-process (gdb-get-instance-buffer 'gdba)) comint-ptyp))
(defun gdb-inferior-io-eof ()
"Send end-of-file to the program being debugged."
- (interactive (list gdb-proc))
+ (interactive)
(process-send-eof
(get-buffer-process (gdb-get-instance-buffer 'gdba))))
\f
(concat indices-string "\t" gdb-display-value "\n"))))
(setq indices-string "")
(setq flag t)
- ; 0<= index < depth, start at right : (- depth 1)
+ ;; 0<= index < depth, start at right : (- depth 1)
(setq index (- (- depth 1)
(- (match-end 2) (match-beginning 2))))
- ;don't set for very last brackets
+ ;;don't set for very last brackets
(if (>= index 0)
(progn
(aset indices index (+ 1 (aref indices index)))
(defun gdb-info-breakpoints-custom ()
(let ((flag)(address))
-; remove all breakpoint-icons in source buffers but not assembler buffer
+ ;; remove all breakpoint-icons in source buffers but not assembler buffer
(let ((buffers (buffer-list)))
(save-excursion
(while buffers
(concat "*breakpoints of " (gdb-instance-target-string) "*")))
(defun gdb-display-breakpoints-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdb-breakpoints-buffer)))
(defun gdb-frame-breakpoints-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdb-breakpoints-buffer)))
(gdb-instance-target-string) "*")))
(defun gdb-display-stack-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdb-stack-buffer)))
(defun gdb-frame-stack-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdb-stack-buffer)))
(concat "*registers of " (gdb-instance-target-string) "*")))
(defun gdb-display-registers-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdb-registers-buffer)))
(defun gdb-frame-registers-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdb-registers-buffer)))
(concat "*locals of " (gdb-instance-target-string) "*")))
(defun gdb-display-locals-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdb-locals-buffer)))
(defun gdb-frame-locals-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdb-locals-buffer)))
;;
(concat "*Displayed expressions of " (gdb-instance-target-string) "*")))
(defun gdb-display-display-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdb-display-buffer)))
(defun gdb-frame-display-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdb-display-buffer)))
;;; Shared keymap initialization:
(defun gdb-display-gdb-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdba)))
(gdb-make-windows-menu gud-minor-mode-map)
(defun gdb-frame-gdb-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdba)))
"Find the source file where the program starts and displays it with related
buffers."
(goto-char (point-min))
- (search-forward "directory is ")
- (looking-at "\\S-*")
- (setq gdb-cdir (match-string 0))
- (search-forward "Located in ")
- (looking-at "\\S-*")
- (setq gdb-main-file (match-string 0))
- ;; Make sure we are not in the minibuffer window when we try to delete
- ;; all other windows.
- (if (window-minibuffer-p (selected-window))
- (other-window 1))
- (delete-other-windows)
- (if gdb-many-windows
- (gdb-setup-windows)
- (gdb-display-breakpoints-buffer)
- (gdb-display-display-buffer)
- (gdb-display-stack-buffer)
+ (when (search-forward "directory is " nil t)
+ (looking-at "\\S-*")
+ (setq gdb-cdir (match-string 0))
+ (search-forward "Located in ")
+ (looking-at "\\S-*")
+ (setq gdb-main-file (match-string 0))
+ ;; Make sure we are not in the minibuffer window when we try to delete
+ ;; all other windows.
+ (if (window-minibuffer-p (selected-window))
+ (other-window 1))
(delete-other-windows)
- (split-window)
- (other-window 1)
- (switch-to-buffer (gud-find-file gdb-main-file))
- (other-window 1)
- (setq gdb-source-window (get-buffer-window (current-buffer)))))
+ (if gdb-many-windows
+ (gdb-setup-windows)
+ (gdb-display-breakpoints-buffer)
+ (gdb-display-display-buffer)
+ (gdb-display-stack-buffer)
+ (delete-other-windows)
+ (split-window)
+ (other-window 1)
+ (switch-to-buffer (gud-find-file gdb-main-file))
+ (other-window 1)
+ (setq gdb-source-window (get-buffer-window (current-buffer))))))
;from put-image
(defun put-string (putstring pos &optional string area)
(concat "*Machine Code " (gdb-instance-target-string) "*")))
(defun gdb-display-assembler-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(gdb-display-buffer
(gdb-get-create-instance-buffer 'gdb-assembler-buffer)))
(defun gdb-frame-assembler-buffer ()
- (interactive (list gdb-proc))
+ (interactive)
(switch-to-buffer-other-frame
(gdb-get-create-instance-buffer 'gdb-assembler-buffer)))