Mercurial > emacs
comparison lisp/progmodes/gdb-ui.el @ 69910:e6d430f1cde3
(gdb-init-1): Re-initialise gdb-main-file to nil.
(gdb-get-version): Make it work for pre "interpreter mi" (GDB 5.3?).
(gdb-setup-windows): Put something in source window if we can't find
the source file.
(gdb-frame-handler): Make it work again with just assembly.
(gdb-data-list-register-values-handler): Make it work when there is
no stack.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Mon, 10 Apr 2006 09:18:11 +0000 |
parents | f91451ffdab7 |
children | f4b6648f6d4f 24cf4bf418dc |
comparison
equal
deleted
inserted
replaced
69909:2ce7c1a8454c | 69910:e6d430f1cde3 |
---|---|
522 gdb-selected-frame nil | 522 gdb-selected-frame nil |
523 gdb-current-language nil | 523 gdb-current-language nil |
524 gdb-frame-number nil | 524 gdb-frame-number nil |
525 gdb-var-list nil | 525 gdb-var-list nil |
526 gdb-force-update t | 526 gdb-force-update t |
527 gdb-main-file nil | |
527 gdb-first-post-prompt t | 528 gdb-first-post-prompt t |
528 gdb-prompting nil | 529 gdb-prompting nil |
529 gdb-input-queue nil | 530 gdb-input-queue nil |
530 gdb-current-item nil | 531 gdb-current-item nil |
531 gdb-pending-triggers nil | 532 gdb-pending-triggers nil |
578 | 579 |
579 (run-hooks 'gdba-mode-hook)) | 580 (run-hooks 'gdba-mode-hook)) |
580 | 581 |
581 (defun gdb-get-version () | 582 (defun gdb-get-version () |
582 (goto-char (point-min)) | 583 (goto-char (point-min)) |
583 (if (and (re-search-forward gdb-error-regexp nil t) | 584 (if (re-search-forward "Undefined\\( mi\\)* command:" nil t) |
584 (string-match ".*(missing implementation)" (match-string 1))) | |
585 (setq gdb-version "pre-6.4") | 585 (setq gdb-version "pre-6.4") |
586 (setq gdb-version "6.4+")) | 586 (setq gdb-version "6.4+")) |
587 (gdb-init-2)) | 587 (gdb-init-2)) |
588 | 588 |
589 (defun gdb-mouse-until (event) | 589 (defun gdb-mouse-until (event) |
2744 (gdb-set-window-buffer (gdb-locals-buffer-name)) | 2744 (gdb-set-window-buffer (gdb-locals-buffer-name)) |
2745 (other-window 1) | 2745 (other-window 1) |
2746 (switch-to-buffer | 2746 (switch-to-buffer |
2747 (if gud-last-last-frame | 2747 (if gud-last-last-frame |
2748 (gud-find-file (car gud-last-last-frame)) | 2748 (gud-find-file (car gud-last-last-frame)) |
2749 (gud-find-file gdb-main-file))) | 2749 (if gdb-main-file |
2750 (gud-find-file gdb-main-file) | |
2751 ;; Put buffer list in window if we | |
2752 ;; can't find a source file. | |
2753 (list-buffers-noselect)))) | |
2750 (when gdb-use-separate-io-buffer | 2754 (when gdb-use-separate-io-buffer |
2751 (split-window-horizontally) | 2755 (split-window-horizontally) |
2752 (other-window 1) | 2756 (other-window 1) |
2753 (gdb-set-window-buffer | 2757 (gdb-set-window-buffer |
2754 (gdb-get-buffer-create 'gdb-inferior-io))) | 2758 (gdb-get-buffer-create 'gdb-inferior-io))) |
3137 (delq 'gdb-get-selected-frame gdb-pending-triggers)) | 3141 (delq 'gdb-get-selected-frame gdb-pending-triggers)) |
3138 (goto-char (point-min)) | 3142 (goto-char (point-min)) |
3139 (if (re-search-forward "Stack level \\([0-9]+\\)" nil t) | 3143 (if (re-search-forward "Stack level \\([0-9]+\\)" nil t) |
3140 (setq gdb-frame-number (match-string 1))) | 3144 (setq gdb-frame-number (match-string 1))) |
3141 (goto-char (point-min)) | 3145 (goto-char (point-min)) |
3142 (if (re-search-forward | 3146 (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-+?\\)\ |
3143 ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\) (\\(\\S-*?\\):[0-9]+?);? " | 3147 \\(?: (\\(\\S-+?\\):[0-9]+?)\\)*;? " |
3144 nil t) | 3148 nil t) |
3145 (progn | 3149 (setq gdb-selected-frame (match-string 2)) |
3146 (setq gdb-selected-frame (match-string 2)) | 3150 (if (gdb-get-buffer 'gdb-locals-buffer) |
3147 (if (gdb-get-buffer 'gdb-locals-buffer) | 3151 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) |
3148 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) | 3152 (setq mode-name (concat "Locals:" gdb-selected-frame)))) |
3149 (setq mode-name (concat "Locals:" gdb-selected-frame)))) | 3153 (if (gdb-get-buffer 'gdb-assembler-buffer) |
3150 (if (gdb-get-buffer 'gdb-assembler-buffer) | 3154 (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer) |
3151 (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer) | 3155 (setq mode-name (concat "Machine:" gdb-selected-frame)))) |
3152 (setq mode-name (concat "Machine:" gdb-selected-frame)))) | 3156 (setq gdb-frame-address (match-string 1)) |
3153 (setq gdb-frame-address (match-string 1)))) | 3157 (if (and (match-string 3) gud-overlay-arrow-position) |
3154 (if gud-overlay-arrow-position | |
3155 (let ((buffer (marker-buffer gud-overlay-arrow-position)) | 3158 (let ((buffer (marker-buffer gud-overlay-arrow-position)) |
3156 (position (marker-position gud-overlay-arrow-position))) | 3159 (position (marker-position gud-overlay-arrow-position))) |
3157 (when (and buffer (string-equal (buffer-name buffer) (match-string 3))) | 3160 (when (and buffer (string-equal (buffer-name buffer) (match-string 3))) |
3158 (with-current-buffer buffer | 3161 (with-current-buffer buffer |
3159 (setq fringe-indicator-alist | 3162 (setq fringe-indicator-alist |
3160 (if (string-equal gdb-frame-number "0") | 3163 (if (string-equal gdb-frame-number "0") |
3161 nil | 3164 nil |
3162 '((overlay-arrow . hollow-right-triangle)))) | 3165 '((overlay-arrow . hollow-right-triangle)))) |
3163 (set-marker gud-overlay-arrow-position position))))) | 3166 (set-marker gud-overlay-arrow-position position)))))) |
3164 (goto-char (point-min)) | 3167 (goto-char (point-min)) |
3165 (if (re-search-forward " source language \\(\\S-*\\)\." nil t) | 3168 (if (re-search-forward " source language \\(\\S-+\\)\." nil t) |
3166 (setq gdb-current-language (match-string 1))) | 3169 (setq gdb-current-language (match-string 1))) |
3167 (gdb-invalidate-assembler)) | 3170 (gdb-invalidate-assembler)) |
3168 | 3171 |
3169 | 3172 |
3170 ;; Code specific to GDB 6.4 | 3173 ;; Code specific to GDB 6.4 |
3279 (defun gdb-data-list-register-values-handler () | 3282 (defun gdb-data-list-register-values-handler () |
3280 (setq gdb-pending-triggers (delq 'gdb-invalidate-registers-1 | 3283 (setq gdb-pending-triggers (delq 'gdb-invalidate-registers-1 |
3281 gdb-pending-triggers)) | 3284 gdb-pending-triggers)) |
3282 (goto-char (point-min)) | 3285 (goto-char (point-min)) |
3283 (if (re-search-forward gdb-error-regexp nil t) | 3286 (if (re-search-forward gdb-error-regexp nil t) |
3284 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) | 3287 (let ((err (match-string 1))) |
3285 (let ((buffer-read-only nil)) | 3288 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) |
3286 (erase-buffer) | 3289 (let ((buffer-read-only nil)) |
3287 (insert (match-string 1)) | 3290 (erase-buffer) |
3288 (goto-char (point-min)))) | 3291 (insert err) |
3292 (goto-char (point-min))))) | |
3289 (let ((register-list (reverse gdb-register-names)) | 3293 (let ((register-list (reverse gdb-register-names)) |
3290 (register nil) (register-string nil) (register-values nil)) | 3294 (register nil) (register-string nil) (register-values nil)) |
3291 (goto-char (point-min)) | 3295 (goto-char (point-min)) |
3292 (while (re-search-forward gdb-data-list-register-values-regexp nil t) | 3296 (while (re-search-forward gdb-data-list-register-values-regexp nil t) |
3293 (setq register (pop register-list)) | 3297 (setq register (pop register-list)) |