Mercurial > emacs
comparison lisp/gdb-ui.el @ 52066:9a40de6a1802
(gdb-setup-windows, gdb-restore-windows): Restore
assembler in source window if that is what has been selected.
(menu): Add gdb-restore-windows to menu. Make gdba
specific menus only visible from gdba.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Mon, 28 Jul 2003 19:49:30 +0000 |
parents | 10f90558dc89 |
children | 57a5b7571acc |
comparison
equal
deleted
inserted
replaced
52065:fbd1cb178c96 | 52066:9a40de6a1802 |
---|---|
555 ("array-section-end" gdb-array-section-end) | 555 ("array-section-end" gdb-array-section-end) |
556 ;; ("elt" gdb-elt) | 556 ;; ("elt" gdb-elt) |
557 ("field-begin" gdb-field-begin) | 557 ("field-begin" gdb-field-begin) |
558 ("field-end" gdb-field-end) | 558 ("field-end" gdb-field-end) |
559 ) "An assoc mapping annotation tags to functions which process them.") | 559 ) "An assoc mapping annotation tags to functions which process them.") |
560 | |
561 (defun gdb-ignore-annotation (args) | |
562 nil) | |
563 | 560 |
564 (defconst gdb-source-spec-regexp | 561 (defconst gdb-source-spec-regexp |
565 "\\(.*\\):\\([0-9]*\\):[0-9]*:[a-z]*:\\(0x[a-f0-9]*\\)") | 562 "\\(.*\\):\\([0-9]*\\):[0-9]*:[a-z]*:\\(0x[a-f0-9]*\\)") |
566 | 563 |
567 ;; Do not use this except as an annotation handler. | 564 ;; Do not use this except as an annotation handler. |
2000 gdb-source-window) | 1997 gdb-source-window) |
2001 | 1998 |
2002 | 1999 |
2003 ;;; Shared keymap initialization: | 2000 ;;; Shared keymap initialization: |
2004 | 2001 |
2005 (define-key gud-menu-map [gdb-many-windows] | |
2006 (menu-bar-make-toggle gdb-many-windows gdb-many-windows | |
2007 "Display other windows" "Many Windows %s" | |
2008 "Display locals, stack and breakpoint information")) | |
2009 | |
2010 (let ((menu (make-sparse-keymap "GDB-Frames"))) | 2002 (let ((menu (make-sparse-keymap "GDB-Frames"))) |
2011 (define-key gud-menu-map [frames] | 2003 (define-key gud-menu-map [frames] |
2012 `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba))) | 2004 `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba))) |
2013 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) | 2005 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) |
2014 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) | 2006 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) |
2032 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) | 2024 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) |
2033 ; (define-key menu [assembler] '("Assembler" . gdb-display-assembler-buffer)) | 2025 ; (define-key menu [assembler] '("Assembler" . gdb-display-assembler-buffer)) |
2034 ) | 2026 ) |
2035 | 2027 |
2036 (let ((menu (make-sparse-keymap "View"))) | 2028 (let ((menu (make-sparse-keymap "View"))) |
2037 (define-key gud-menu-map [view] `(menu-item "View" ,menu)) | 2029 (define-key gud-menu-map [view] |
2030 `(menu-item "View" ,menu :visible (eq gud-minor-mode 'gdba))) | |
2038 ; (define-key menu [both] '(menu-item "Both" gdb-view-both | 2031 ; (define-key menu [both] '(menu-item "Both" gdb-view-both |
2039 ; :help "Display both source and assembler" | 2032 ; :help "Display both source and assembler" |
2040 ; :button (:radio . (eq gdb-selected-view 'both)))) | 2033 ; :button (:radio . (eq gdb-selected-view 'both)))) |
2041 (define-key menu [assembler] '(menu-item "Assembler" gdb-view-assembler | 2034 (define-key menu [assembler] '(menu-item "Assembler" gdb-view-assembler |
2042 :help "Display assembler only" | 2035 :help "Display assembler only" |
2043 :button (:radio . (eq gdb-selected-view 'assembler)))) | 2036 :button (:radio . (eq gdb-selected-view 'assembler)))) |
2044 (define-key menu [source] '(menu-item "Source" gdb-view-source-function | 2037 (define-key menu [source] '(menu-item "Source" gdb-view-source-function |
2045 :help "Display source only" | 2038 :help "Display source only" |
2046 :button (:radio . (eq gdb-selected-view 'source))))) | 2039 :button (:radio . (eq gdb-selected-view 'source))))) |
2040 | |
2041 (let ((menu (make-sparse-keymap "GDB-UI"))) | |
2042 (define-key gud-menu-map [ui] | |
2043 `(menu-item "GDB-UI" ,menu :visible (eq gud-minor-mode 'gdba))) | |
2044 (define-key menu [gdb-restore-windows] | |
2045 '("Restore window layout" . gdb-restore-windows)) | |
2046 (define-key menu [gdb-many-windows] | |
2047 (menu-bar-make-toggle gdb-many-windows gdb-many-windows | |
2048 "Display other windows" "Many Windows %s" | |
2049 "Display locals, stack and breakpoint information"))) | |
2047 | 2050 |
2048 (defun gdb-frame-gdb-buffer () | 2051 (defun gdb-frame-gdb-buffer () |
2049 (interactive) | 2052 (interactive) |
2050 (switch-to-buffer-other-frame | 2053 (switch-to-buffer-other-frame |
2051 (gdb-get-create-buffer 'gdba))) | 2054 (gdb-get-create-buffer 'gdba))) |
2089 (split-window nil ( / (window-height) 3)) | 2092 (split-window nil ( / (window-height) 3)) |
2090 (split-window-horizontally) | 2093 (split-window-horizontally) |
2091 (other-window 1) | 2094 (other-window 1) |
2092 (switch-to-buffer (gdb-locals-buffer-name)) | 2095 (switch-to-buffer (gdb-locals-buffer-name)) |
2093 (other-window 1) | 2096 (other-window 1) |
2094 (if gdb-view-source | 2097 (if (and gdb-view-source |
2098 (eq gdb-selected-view 'source)) | |
2095 (switch-to-buffer | 2099 (switch-to-buffer |
2096 (if gud-last-last-frame | 2100 (if gud-last-last-frame |
2097 (gud-find-file (car gud-last-last-frame)) | 2101 (gud-find-file (car gud-last-last-frame)) |
2098 (gud-find-file gdb-main-file))) | 2102 (gud-find-file gdb-main-file))) |
2099 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))) | 2103 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))) |
2134 (gdb-setup-windows)) | 2138 (gdb-setup-windows)) |
2135 (switch-to-buffer gud-comint-buffer) | 2139 (switch-to-buffer gud-comint-buffer) |
2136 (delete-other-windows) | 2140 (delete-other-windows) |
2137 (split-window) | 2141 (split-window) |
2138 (other-window 1) | 2142 (other-window 1) |
2139 (if gdb-view-source | 2143 (if (and gdb-view-source |
2144 (eq gdb-selected-view 'source)) | |
2140 (switch-to-buffer | 2145 (switch-to-buffer |
2141 (if gud-last-last-frame | 2146 (if gud-last-last-frame |
2142 (gud-find-file (car gud-last-last-frame)) | 2147 (gud-find-file (car gud-last-last-frame)) |
2143 (gud-find-file gdb-main-file))) | 2148 (gud-find-file gdb-main-file))) |
2144 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))) | 2149 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))) |