comparison lisp/gdb-ui.el @ 48300:69646014abb3

Fix feature name in `require'.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 14 Nov 2002 08:57:04 +0000
parents 27d9e4538750
children 8fdedd7dca85
comparison
equal deleted inserted replaced
48299:21b6ba166466 48300:69646014abb3
27 27
28 ;; Extension of gdba.el written by Jim Kingdon from gdb 5.0 28 ;; Extension of gdba.el written by Jim Kingdon from gdb 5.0
29 29
30 ;;; Code: 30 ;;; Code:
31 31
32 (require 'mygud) 32 (require 'gud)
33 33
34 (defcustom gdb-many-windows t 34 (defcustom gdb-many-windows t
35 "If t, using gdba, start gdb with ancillary buffers visible. 35 "If t, using gdba, start gdb with ancillary buffers visible.
36 Use `toggle-gdb-windows' to change this value during a gdb session" 36 Use `toggle-gdb-windows' to change this value during a gdb session"
37 :type 'boolean 37 :type 'boolean
79 icons are displayed both by setting a break with gud-break and by typing break 79 icons are displayed both by setting a break with gud-break and by typing break
80 in the GUD buffer. 80 in the GUD buffer.
81 81
82 Displayed expressions appear in separate frames. Arrays may be displayed 82 Displayed expressions appear in separate frames. Arrays may be displayed
83 as slices and visualised using the graph program from plotutils if installed. 83 as slices and visualised using the graph program from plotutils if installed.
84 84
85 If `gdb-many-windows' is set to nil then gdb starts with just two windows : 85 If `gdb-many-windows' is set to nil then gdb starts with just two windows :
86 the GUD and the source buffer. 86 the GUD and the source buffer.
87 87
88 The following interactive lisp functions help control operation : 88 The following interactive lisp functions help control operation :
89 89
281 ;; 281 ;;
282 ;; In this world, there are gdb instance objects (of unspecified 282 ;; In this world, there are gdb instance objects (of unspecified
283 ;; representation) and buffers associated with those objects. 283 ;; representation) and buffers associated with those objects.
284 ;; 284 ;;
285 285
286 ;; 286 ;;
287 ;; gdb-instance objects 287 ;; gdb-instance objects
288 ;; 288 ;;
289 289
290 (defun make-gdb-instance (proc) 290 (defun make-gdb-instance (proc)
291 "Create a gdb instance object from a gdb process." 291 "Create a gdb instance object from a gdb process."
292 (setq last-proc proc) 292 (setq last-proc proc)
293 (let ((instance (cons 'gdb-instance proc))) 293 (let ((instance (cons 'gdb-instance proc)))
1297 1297
1298 (while (string-match "\n\032\032\\(.*\\)\n" burst) 1298 (while (string-match "\n\032\032\\(.*\\)\n" burst)
1299 (let ((annotation (substring burst 1299 (let ((annotation (substring burst
1300 (match-beginning 1) 1300 (match-beginning 1)
1301 (match-end 1)))) 1301 (match-end 1))))
1302 1302
1303 ;; Stuff prior to the match is just ordinary output. 1303 ;; Stuff prior to the match is just ordinary output.
1304 ;; It is either concatenated to OUTPUT or directed 1304 ;; It is either concatenated to OUTPUT or directed
1305 ;; elsewhere. 1305 ;; elsewhere.
1306 (setq output 1306 (setq output
1307 (gdb-concat-output 1307 (gdb-concat-output
1309 output 1309 output
1310 (substring burst 0 (match-beginning 0)))) 1310 (substring burst 0 (match-beginning 0))))
1311 1311
1312 ;; Take that stuff off the burst. 1312 ;; Take that stuff off the burst.
1313 (setq burst (substring burst (match-end 0))) 1313 (setq burst (substring burst (match-end 0)))
1314 1314
1315 ;; Parse the tag from the annotation, and maybe its arguments. 1315 ;; Parse the tag from the annotation, and maybe its arguments.
1316 (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) 1316 (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation)
1317 (let* ((annotation-type (substring annotation 1317 (let* ((annotation-type (substring annotation
1318 (match-beginning 1) 1318 (match-beginning 1)
1319 (match-end 1))) 1319 (match-end 1)))
1414 ;; the command behind the user's back. 1414 ;; the command behind the user's back.
1415 ;; 1415 ;;
1416 ;; The idle input queue and the output phasing associated with 1416 ;; The idle input queue and the output phasing associated with
1417 ;; the instance variable `(gdb-instance-output-sink instance)' help 1417 ;; the instance variable `(gdb-instance-output-sink instance)' help
1418 ;; us to run commands behind the user's back. 1418 ;; us to run commands behind the user's back.
1419 ;; 1419 ;;
1420 ;; Below is the code for specificly managing buffers of output from one 1420 ;; Below is the code for specificly managing buffers of output from one
1421 ;; command. 1421 ;; command.
1422 ;; 1422 ;;
1423 1423
1424 1424
1441 (list ,gdb-command ',output-handler)) 1441 (list ,gdb-command ',output-handler))
1442 (set-gdb-instance-pending-triggers 1442 (set-gdb-instance-pending-triggers
1443 instance 1443 instance
1444 (cons ',name 1444 (cons ',name
1445 (gdb-instance-pending-triggers instance))))))) 1445 (gdb-instance-pending-triggers instance)))))))
1446 1446
1447 (defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun) 1447 (defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun)
1448 `(defun ,name () 1448 `(defun ,name ()
1449 (set-gdb-instance-pending-triggers 1449 (set-gdb-instance-pending-triggers
1450 instance 1450 instance
1451 (delq ',trigger 1451 (delq ',trigger
1478 ,trigger-name ,buffer-key ,custom-defun))) 1478 ,trigger-name ,buffer-key ,custom-defun)))
1479 1479
1480 1480
1481 ;; 1481 ;;
1482 ;; Breakpoint buffers 1482 ;; Breakpoint buffers
1483 ;; 1483 ;;
1484 ;; These display the output of `info breakpoints'. 1484 ;; These display the output of `info breakpoints'.
1485 ;; 1485 ;;
1486 1486
1487 1487
1488 (gdb-set-instance-buffer-rules 'gdb-breakpoints-buffer 1488 (gdb-set-instance-buffer-rules 'gdb-breakpoints-buffer
2101 (cur-size (window-height largest)) 2101 (cur-size (window-height largest))
2102 (new-size (and size (< size cur-size) (- cur-size size)))) 2102 (new-size (and size (< size cur-size) (- cur-size size))))
2103 (setq answer (split-window largest new-size)) 2103 (setq answer (split-window largest new-size))
2104 (set-window-buffer answer buf))) 2104 (set-window-buffer answer buf)))
2105 answer)) 2105 answer))
2106 2106
2107 (defun gdb-display-source-buffer (buffer) 2107 (defun gdb-display-source-buffer (buffer)
2108 (set-window-buffer gdb-source-window buffer)) 2108 (set-window-buffer gdb-source-window buffer))
2109 2109
2110 2110
2111 ;;; Shared keymap initialization: 2111 ;;; Shared keymap initialization: