diff options
| author | Nick Roberts | 2003-05-25 16:51:34 +0000 |
|---|---|---|
| committer | Nick Roberts | 2003-05-25 16:51:34 +0000 |
| commit | eef0be881a510ed910d39c8aa90f73c361925c84 (patch) | |
| tree | 701fbbeb1848249b38a9e6f04ab2e2d2be53b76d | |
| parent | cfec25c34f5ae0f3ca2ed9b0029c11e1cbc4884d (diff) | |
| download | emacs-eef0be881a510ed910d39c8aa90f73c361925c84.tar.gz emacs-eef0be881a510ed910d39c8aa90f73c361925c84.zip | |
(gdb-info-breakpoints-custom, gdb-assembler-custom):
Put string associated with breakpoint at start of line so that it
is always visible.
(gdb-display-source-buffer): Display assembler during execution,
when requested.
(gud-menu-map): Add a toggle button to menubar for
gdb-many-windows.
(gdb-many-windows): Define explicitly as a function and a variable
(formerly as a minor mode). These need to be global so layout can
be reset from any buffer.
(gdb-assembler-mode): Keep fringe outside margin as the overlay
arrow is not used for assembler.
| -rw-r--r-- | lisp/gdb-ui.el | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el index 18643f44d86..c20145b4ebf 100644 --- a/lisp/gdb-ui.el +++ b/lisp/gdb-ui.el | |||
| @@ -51,7 +51,7 @@ | |||
| 51 | (require 'gud) | 51 | (require 'gud) |
| 52 | 52 | ||
| 53 | (defcustom gdb-window-height 20 | 53 | (defcustom gdb-window-height 20 |
| 54 | "*Number of lines in a frame for a displayed expression in GDB-UI." | 54 | "Number of lines in a frame for a displayed expression in GDB-UI." |
| 55 | :type 'integer | 55 | :type 'integer |
| 56 | :group 'gud) | 56 | :group 'gud) |
| 57 | 57 | ||
| @@ -1384,16 +1384,17 @@ static char *magick[] = { | |||
| 1384 | (remove-images start end) | 1384 | (remove-images start end) |
| 1385 | (if (eq ?y flag) | 1385 | (if (eq ?y flag) |
| 1386 | (put-image breakpoint-enabled-icon | 1386 | (put-image breakpoint-enabled-icon |
| 1387 | (point) | 1387 | (+ start 1) |
| 1388 | "breakpoint icon enabled" | 1388 | "breakpoint icon enabled" |
| 1389 | 'left-margin) | 1389 | 'left-margin) |
| 1390 | (put-image breakpoint-disabled-icon (point) | 1390 | (put-image breakpoint-disabled-icon |
| 1391 | (+ start 1) | ||
| 1391 | "breakpoint icon disabled" | 1392 | "breakpoint icon disabled" |
| 1392 | 'left-margin))) | 1393 | 'left-margin))) |
| 1393 | (gdb-remove-strings start end) | 1394 | (gdb-remove-strings start end) |
| 1394 | (if (eq ?y flag) | 1395 | (if (eq ?y flag) |
| 1395 | (gdb-put-string "B" (point)) | 1396 | (gdb-put-string "B" (+ start 1)) |
| 1396 | (gdb-put-string "b" (point)))))))))))) | 1397 | (gdb-put-string "b" (+ start 1)))))))))))) |
| 1397 | (end-of-line)))))) | 1398 | (end-of-line)))))) |
| 1398 | 1399 | ||
| 1399 | (defun gdb-breakpoints-buffer-name () | 1400 | (defun gdb-breakpoints-buffer-name () |
| @@ -1985,12 +1986,20 @@ the source buffer." | |||
| 1985 | answer)) | 1986 | answer)) |
| 1986 | 1987 | ||
| 1987 | (defun gdb-display-source-buffer (buffer) | 1988 | (defun gdb-display-source-buffer (buffer) |
| 1988 | (set-window-buffer gdb-source-window buffer) | 1989 | (if (eq gdb-selected-view 'source) |
| 1990 | (set-window-buffer gdb-source-window buffer) | ||
| 1991 | (set-window-buffer gdb-source-window | ||
| 1992 | (gdb-get-buffer 'gdb-assembler-buffer))) | ||
| 1989 | gdb-source-window) | 1993 | gdb-source-window) |
| 1990 | 1994 | ||
| 1991 | 1995 | ||
| 1992 | ;;; Shared keymap initialization: | 1996 | ;;; Shared keymap initialization: |
| 1993 | 1997 | ||
| 1998 | (define-key gud-menu-map [gdb-many-windows] | ||
| 1999 | (menu-bar-make-toggle gdb-many-windows gdb-many-windows | ||
| 2000 | "Display other windows" "Many Windows %s" | ||
| 2001 | "Display locals, stack and breakpoint information")) | ||
| 2002 | |||
| 1994 | (let ((menu (make-sparse-keymap "GDB-Frames"))) | 2003 | (let ((menu (make-sparse-keymap "GDB-Frames"))) |
| 1995 | (define-key gud-menu-map [frames] | 2004 | (define-key gud-menu-map [frames] |
| 1996 | `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba))) | 2005 | `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba))) |
| @@ -2091,10 +2100,19 @@ the source buffer." | |||
| 2091 | (switch-to-buffer (gdb-breakpoints-buffer-name)) | 2100 | (switch-to-buffer (gdb-breakpoints-buffer-name)) |
| 2092 | (other-window 1)) | 2101 | (other-window 1)) |
| 2093 | 2102 | ||
| 2094 | (define-minor-mode gdb-many-windows | 2103 | (defcustom gdb-many-windows nil |
| 2095 | "Toggle the number of windows in the basic arrangement." | 2104 | "Nil means that gdb starts with just two windows : the GUD and |
| 2096 | :group 'gud | 2105 | the source buffer." |
| 2097 | :init-value nil | 2106 | :type 'boolean |
| 2107 | :group 'gud) | ||
| 2108 | |||
| 2109 | (defun gdb-many-windows (arg) | ||
| 2110 | "Toggle the number of windows in the basic arrangement." | ||
| 2111 | (interactive "P") | ||
| 2112 | (setq gdb-many-windows | ||
| 2113 | (if (null arg) | ||
| 2114 | (not gdb-many-windows) | ||
| 2115 | (> (prefix-numeric-value arg) 0))) | ||
| 2098 | (gdb-restore-windows)) | 2116 | (gdb-restore-windows)) |
| 2099 | 2117 | ||
| 2100 | (defun gdb-restore-windows () | 2118 | (defun gdb-restore-windows () |
| @@ -2309,16 +2327,18 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2309 | (progn | 2327 | (progn |
| 2310 | (remove-images start end) | 2328 | (remove-images start end) |
| 2311 | (if (eq ?y flag) | 2329 | (if (eq ?y flag) |
| 2312 | (put-image breakpoint-enabled-icon (point) | 2330 | (put-image breakpoint-enabled-icon |
| 2331 | (+ start 1) | ||
| 2313 | "breakpoint icon enabled" | 2332 | "breakpoint icon enabled" |
| 2314 | 'left-margin) | 2333 | 'left-margin) |
| 2315 | (put-image breakpoint-disabled-icon (point) | 2334 | (put-image breakpoint-disabled-icon |
| 2335 | (+ start 1) | ||
| 2316 | "breakpoint icon disabled" | 2336 | "breakpoint icon disabled" |
| 2317 | 'left-margin))) | 2337 | 'left-margin))) |
| 2318 | (gdb-remove-strings start end) | 2338 | (gdb-remove-strings start end) |
| 2319 | (if (eq ?y flag) | 2339 | (if (eq ?y flag) |
| 2320 | (gdb-put-string "B" (point)) | 2340 | (gdb-put-string "B" (+ start 1)) |
| 2321 | (gdb-put-string "b" (point))))))))))))) | 2341 | (gdb-put-string "b" (+ start 1))))))))))))) |
| 2322 | 2342 | ||
| 2323 | (defvar gdb-assembler-mode-map | 2343 | (defvar gdb-assembler-mode-map |
| 2324 | (let ((map (make-sparse-keymap))) | 2344 | (let ((map (make-sparse-keymap))) |
| @@ -2332,6 +2352,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2332 | (setq major-mode 'gdb-assembler-mode) | 2352 | (setq major-mode 'gdb-assembler-mode) |
| 2333 | (setq mode-name "Assembler") | 2353 | (setq mode-name "Assembler") |
| 2334 | (setq left-margin-width 2) | 2354 | (setq left-margin-width 2) |
| 2355 | (setq fringes-outside-margins t) | ||
| 2335 | (setq buffer-read-only t) | 2356 | (setq buffer-read-only t) |
| 2336 | (use-local-map gdb-assembler-mode-map) | 2357 | (use-local-map gdb-assembler-mode-map) |
| 2337 | (gdb-invalidate-assembler) | 2358 | (gdb-invalidate-assembler) |