comparison lisp/comint/gdb.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 8fc7fe29b841
children b9518feda344
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of 18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details. 20 ;; General Public License for more details.
21 21
22 ;; You should have received a copy of the GNU General Public License 22 ;; You should have received a copy of the GNU General Public License
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free 23 ;; along with XEmacs; see the file COPYING. If not, write to the
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; 02111-1307, USA. 25 ;; Boston, MA 02111-1307, USA.
26
27 ;;; Synched up with: Not in FSF
28
29 ;;; Commentary:
30 26
31 ;; Description of GDB interface: 27 ;; Description of GDB interface:
32 28
33 ;; A facility is provided for the simultaneous display of the source code 29 ;; A facility is provided for the simultaneous display of the source code
34 ;; in one window, while using gdb to step through a function in the 30 ;; in one window, while using gdb to step through a function in the
59 ;; into one of the frames, it would display the position corresponding to 55 ;; into one of the frames, it would display the position corresponding to
60 ;; that frame. 56 ;; that frame.
61 57
62 ;; gdb-display-frame is invoked automatically when a filename-and-line-number 58 ;; gdb-display-frame is invoked automatically when a filename-and-line-number
63 ;; appears in the output. 59 ;; appears in the output.
64
65 ;;; Code:
66 60
67 (require 'comint) 61 (require 'comint)
68 (require 'shell) 62 (require 'shell)
69 63
70 (condition-case nil 64 (condition-case nil
241 \\[send-gdb-command] used for special printing of an arg at the current point. 235 \\[send-gdb-command] used for special printing of an arg at the current point.
242 C-x SPACE sets break point at current line." 236 C-x SPACE sets break point at current line."
243 (interactive) 237 (interactive)
244 (comint-mode) 238 (comint-mode)
245 (use-local-map gdb-mode-map) 239 (use-local-map gdb-mode-map)
246 (when (not (boundp 'c-mode-syntax-table))
247 (require 'cc-mode))
248 (set-syntax-table c-mode-syntax-table) 240 (set-syntax-table c-mode-syntax-table)
249 (make-local-variable 'gdb-last-frame-displayed-p) 241 (make-local-variable 'gdb-last-frame-displayed-p)
250 (make-local-variable 'gdb-last-frame) 242 (make-local-variable 'gdb-last-frame)
251 (make-local-variable 'gdb-delete-prompt-marker) 243 (make-local-variable 'gdb-delete-prompt-marker)
252 (make-local-variable 'gdb-display-mode) 244 (make-local-variable 'gdb-display-mode)
265 (delete-extent gdb-arrow-extent)) 257 (delete-extent gdb-arrow-extent))
266 (setq gdb-arrow-extent nil) 258 (setq gdb-arrow-extent nil)
267 ;; XEmacs change: 259 ;; XEmacs change:
268 (make-local-hook 'kill-buffer-hook) 260 (make-local-hook 'kill-buffer-hook)
269 (add-hook 'kill-buffer-hook 'gdb-delete-arrow-extent nil t) 261 (add-hook 'kill-buffer-hook 'gdb-delete-arrow-extent nil t)
270 (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t) 262 (setq comint-input-sentinel 'shell-directory-tracker)
271 (run-hooks 'gdb-mode-hook)) 263 (run-hooks 'gdb-mode-hook))
272 264
273 (defun gdb-delete-arrow-extent () 265 (defun gdb-delete-arrow-extent ()
274 (let ((inhibit-quit t)) 266 (let ((inhibit-quit t))
275 (if gdb-arrow-extent 267 (if gdb-arrow-extent
650 (t (setq comm addr))) 642 (t (setq comm addr)))
651 (switch-to-buffer current-gdb-buffer) 643 (switch-to-buffer current-gdb-buffer)
652 (goto-char (point-max)) 644 (goto-char (point-max))
653 (insert comm))) 645 (insert comm)))
654 646
655 (fset 'gdb-control-c-subjob 'comint-interrupt-subjob) 647 (defun gdb-control-c-subjob ()
656 648 "Send a Control-C to the subprocess."
657 ;(defun gdb-control-c-subjob () 649 (interactive)
658 ; "Send a Control-C to the subprocess." 650 (process-send-string (get-buffer-process (current-buffer))
659 ; (interactive) 651 "\C-c"))
660 ; (process-send-string (get-buffer-process (current-buffer))
661 ; "\C-c"))
662 652
663 (defun gdb-toolbar-break () 653 (defun gdb-toolbar-break ()
664 (interactive) 654 (interactive)
665 (save-excursion 655 (save-excursion
666 (message (car gdb-last-frame)) 656 (message (car gdb-last-frame))
673 (message (car gdb-last-frame)) 663 (message (car gdb-last-frame))
674 (set-buffer (find-file-noselect (car gdb-last-frame))) 664 (set-buffer (find-file-noselect (car gdb-last-frame)))
675 (gdb-clear))) 665 (gdb-clear)))
676 666
677 (provide 'gdb) 667 (provide 'gdb)
678
679 ;;; gdb.el ends here