/[emacs]/emacs/lisp/gdb-ui.el
ViewVC logotype

Diff of /emacs/lisp/gdb-ui.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by nickrob, Tue Jan 14 23:58:13 2003 UTC revision 1.25 by lektu, Tue Feb 4 11:21:47 2003 UTC
# Line 41  Line 41 
41  ;; developing the mode itself, then see the Annotations section in the GDB  ;; developing the mode itself, then see the Annotations section in the GDB
42  ;; info manual.  ;; info manual.
43  ;;  ;;
44  ;;  Known Bugs: Does not auto-display arrays of structures or structures  ;;  Known Bugs: Does not auto-display arrays of structures or structures
45  ;;  containing arrays.  ;;  containing arrays.
46    
47  ;;; Code:  ;;; Code:
# Line 116  The following interactive lisp functions Line 116  The following interactive lisp functions
116    
117  `gdb-many-windows'    - Toggle the number of windows gdb uses.  `gdb-many-windows'    - Toggle the number of windows gdb uses.
118  `gdb-restore-windows' - To restore the window layout.  `gdb-restore-windows' - To restore the window layout.
119  `gdb-quit'            - To delete (most) of the buffers used by GDB-UI and  `gdb-quit'            - To delete (most) of the buffers used by GDB-UI and
120                          reset variables."                          reset variables."
121    ;;    ;;
122    (interactive (list (gud-query-cmdline 'gdba)))    (interactive (list (gud-query-cmdline 'gdba)))
# Line 530  This filter may simply queue output for Line 530  This filter may simply queue output for
530      ("display-end" gdb-display-end)      ("display-end" gdb-display-end)
531  ; GDB commands info stack, info locals and frame generate an error-begin  ; GDB commands info stack, info locals and frame generate an error-begin
532  ; annotation at start when there is no stack but this is a quirk/bug in  ; annotation at start when there is no stack but this is a quirk/bug in
533  ; annotations.    ; annotations.
534  ;    ("error-begin" gdb-error-begin)  ;    ("error-begin" gdb-error-begin)
535      ("display-number-end" gdb-display-number-end)      ("display-number-end" gdb-display-number-end)
536      ("array-section-begin" gdb-array-section-begin)      ("array-section-begin" gdb-array-section-begin)
# Line 582  output from a previous command if that h Line 582  output from a previous command if that h
582        (let ((handler        (let ((handler
583               (car (cdr (gdb-get-current-item)))))               (car (cdr (gdb-get-current-item)))))
584          (save-excursion          (save-excursion
585            (set-buffer (gdb-get-create-buffer            (set-buffer (gdb-get-create-buffer
586                         'gdb-partial-output-buffer))                         'gdb-partial-output-buffer))
587            (funcall handler))))            (funcall handler))))
588       (t       (t
# Line 590  output from a previous command if that h Line 590  output from a previous command if that h
590        (error "Output sink phase error 1")))))        (error "Output sink phase error 1")))))
591    
592  (defun gdb-prompt (ignored)  (defun gdb-prompt (ignored)
593    "An annotation handler for `prompt'.    "An annotation handler for `prompt'.
594  This sends the next command (if any) to gdb."  This sends the next command (if any) to gdb."
595    (let ((sink (gdb-get-output-sink)))    (let ((sink (gdb-get-output-sink)))
596      (cond      (cond
# Line 714  output from the current command if that Line 714  output from the current command if that
714                (if (string-equal (frame-parameter frame 'name)                (if (string-equal (frame-parameter frame 'name)
715                                  gdb-expression-buffer-name)                                  gdb-expression-buffer-name)
716                    (throw 'frame-exists nil)))                    (throw 'frame-exists nil)))
717              (make-frame `((height . ,gdb-window-height)              (make-frame `((height . ,gdb-window-height)
718                            (width . ,gdb-window-width)                            (width . ,gdb-window-width)
719                            (tool-bar-lines . nil)                            (tool-bar-lines . nil)
720                            (menu-bar-lines . nil)                            (menu-bar-lines . nil)
# Line 1082  output from the current command if that Line 1082  output from the current command if that
1082          ;; It is either concatenated to OUTPUT or directed          ;; It is either concatenated to OUTPUT or directed
1083          ;; elsewhere.          ;; elsewhere.
1084          (setq output          (setq output
1085                (gdb-concat-output                (gdb-concat-output
1086                 output                 output
1087                 (substring burst 0 (match-beginning 0))))                 (substring burst 0 (match-beginning 0))))
1088    
# Line 1262  output from the current command if that Line 1262  output from the current command if that
1262    gdb-info-breakpoints-custom)    gdb-info-breakpoints-custom)
1263    
1264  (defvar gdb-cdir nil "Compilation directory.")  (defvar gdb-cdir nil "Compilation directory.")
1265  (defvar breakpoint-enabled-icon)  (defvar breakpoint-enabled-icon)
1266  (defvar breakpoint-disabled-icon)  (defvar breakpoint-disabled-icon)
1267    
1268  ;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)  ;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
# Line 1299  output from the current command if that Line 1299  output from the current command if that
1299                                             'mouse-face 'highlight)                                             'mouse-face 'highlight)
1300                          (save-excursion                          (save-excursion
1301                            (set-buffer                            (set-buffer
1302                             (find-file-noselect                             (find-file-noselect
1303                              (if (file-exists-p file) file                              (if (file-exists-p file) file
1304                                (expand-file-name file gdb-cdir))))                                (expand-file-name file gdb-cdir))))
1305                            (save-current-buffer                            (save-current-buffer
# Line 1315  output from the current command if that Line 1315  output from the current command if that
1315                            ;; only want one breakpoint icon at each location                            ;; only want one breakpoint icon at each location
1316                            (save-excursion                            (save-excursion
1317                              (goto-line (string-to-number line))                              (goto-line (string-to-number line))
1318                              (let ((start (progn (beginning-of-line)                              (let ((start (progn (beginning-of-line)
1319                                                  (- (point) 1)))                                                  (- (point) 1)))
1320                                    (end (progn (end-of-line) (+ (point) 1))))                                    (end (progn (end-of-line) (+ (point) 1))))
1321                                (if (display-graphic-p)                                (if (display-graphic-p)
1322                                    (progn                                    (progn
1323                                      (remove-images start end)                                      (remove-images start end)
1324                                      (if (eq ?y flag)                                      (if (eq ?y flag)
1325                                          (put-image breakpoint-enabled-icon                                          (put-image breakpoint-enabled-icon
1326                                                     (point)                                                     (point)
1327                                                     "breakpoint icon enabled"                                                     "breakpoint icon enabled"
1328                                                     'left-margin)                                                     'left-margin)
# Line 1387  output from the current command if that Line 1387  output from the current command if that
1387         (list         (list
1388          (concat          (concat
1389           (if (eq ?y (char-after (match-beginning 2)))           (if (eq ?y (char-after (match-beginning 2)))
1390               "server disable "               "server disable "
1391             "server enable ")             "server enable ")
1392           (match-string 1) "\n")           (match-string 1) "\n")
1393          'ignore)))))          'ignore)))))
# Line 1564  the source buffer." Line 1564  the source buffer."
1564    gdb-info-locals-handler    gdb-info-locals-handler
1565    gdb-info-locals-custom)    gdb-info-locals-custom)
1566    
1567  ;; Abbreviate for arrays and structures.  ;; Abbreviate for arrays and structures.
1568  ;; These can be expanded using gud-display.  ;; These can be expanded using gud-display.
1569  (defun gdb-info-locals-handler nil  (defun gdb-info-locals-handler nil
1570    (gdb-set-pending-triggers (delq 'gdb-invalidate-locals    (gdb-set-pending-triggers (delq 'gdb-invalidate-locals
# Line 1646  the source buffer." Line 1646  the source buffer."
1646        (while (< (point) (- (point-max) 1))        (while (< (point) (- (point-max) 1))
1647          (forward-line 1)          (forward-line 1)
1648          (if (looking-at "\\([0-9]+\\):   \\([ny]\\)")          (if (looking-at "\\([0-9]+\\):   \\([ny]\\)")
1649              (setq display-list              (setq display-list
1650                    (cons (string-to-int (match-string 1)) display-list)))                    (cons (string-to-int (match-string 1)) display-list)))
1651          (end-of-line)))          (end-of-line)))
1652      (if (not (display-graphic-p))      (if (not (display-graphic-p))
# Line 1654  the source buffer." Line 1654  the source buffer."
1654            (dolist (buffer (buffer-list))            (dolist (buffer (buffer-list))
1655              (if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer))              (if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer))
1656                  (progn                  (progn
1657                    (let ((number                    (let ((number
1658                           (match-string 1 (buffer-name buffer))))                           (match-string 1 (buffer-name buffer))))
1659                      (if (not (memq (string-to-int number) display-list))                      (if (not (memq (string-to-int number) display-list))
1660                          (kill-buffer                          (kill-buffer
1661                           (get-buffer (concat "*display " number "*")))))))))                           (get-buffer (concat "*display " number "*")))))))))
1662        (gdb-delete-frames display-list))))        (gdb-delete-frames display-list))))
1663    
# Line 2233  BUFFER nil or omitted means use the curr Line 2233  BUFFER nil or omitted means use the curr
2233    
2234  (defun gdb-get-current-frame ()  (defun gdb-get-current-frame ()
2235    (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))    (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
2236        (progn        (progn
2237          (gdb-enqueue-idle-input          (gdb-enqueue-idle-input
2238           (list (concat "server frame\n") 'gdb-frame-handler))           (list (concat "server frame\n") 'gdb-frame-handler))
2239          (gdb-set-pending-triggers          (gdb-set-pending-triggers
2240           (cons 'gdb-get-current-frame           (cons 'gdb-get-current-frame
2241                 (gdb-get-pending-triggers))))))                 (gdb-get-pending-triggers))))))
2242    
2243  (defun gdb-frame-handler ()  (defun gdb-frame-handler ()
2244    (gdb-set-pending-triggers    (gdb-set-pending-triggers
2245     (delq 'gdb-get-current-frame (gdb-get-pending-triggers)))     (delq 'gdb-get-current-frame (gdb-get-pending-triggers)))
2246    (save-excursion    (save-excursion
2247      (set-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer))      (set-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer))
2248      (goto-char (point-min))      (goto-char (point-min))
2249      (if (looking-at "^#[0-9]*\\s-*0x\\S-* in \\(\\S-*\\)")      (if (looking-at "^#[0-9]*\\s-*0x\\S-* in \\(\\S-*\\)")

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26