Mercurial > emacs
comparison lisp/gdb-ui.el @ 48662:d29870d63092
Fix up comment markers.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 04 Dec 2002 18:52:48 +0000 |
parents | b092bff770ec |
children | a74dd42cf01d |
comparison
equal
deleted
inserted
replaced
48661:b092bff770ec | 48662:d29870d63092 |
---|---|
121 (local-set-key "\C-i" 'gud-gdb-complete-command) | 121 (local-set-key "\C-i" 'gud-gdb-complete-command) |
122 | 122 |
123 (setq comint-prompt-regexp "^(.*gdb[+]?) *") | 123 (setq comint-prompt-regexp "^(.*gdb[+]?) *") |
124 (setq comint-input-sender 'gdb-send) | 124 (setq comint-input-sender 'gdb-send) |
125 | 125 |
126 ; (re-)initialise | 126 ;; (re-)initialise |
127 (setq gdb-main-or-pc "main") | 127 (setq gdb-main-or-pc "main") |
128 (setq gdb-current-address nil) | 128 (setq gdb-current-address nil) |
129 (setq gdb-display-in-progress nil) | 129 (setq gdb-display-in-progress nil) |
130 (setq gdb-dive nil) | 130 (setq gdb-dive nil) |
131 (setq gud-last-last-frame nil) | 131 (setq gud-last-last-frame nil) |
134 (run-hooks 'gdb-mode-hook) | 134 (run-hooks 'gdb-mode-hook) |
135 (setq gdb-proc (get-buffer-process (current-buffer))) | 135 (setq gdb-proc (get-buffer-process (current-buffer))) |
136 (gdb-make-instance) | 136 (gdb-make-instance) |
137 (if gdb-first-time (gdb-clear-inferior-io)) | 137 (if gdb-first-time (gdb-clear-inferior-io)) |
138 | 138 |
139 ; find source file and compilation directory here | 139 ;; find source file and compilation directory here |
140 (gdb-instance-enqueue-idle-input (list "server list\n" 'ignore)) | 140 (gdb-instance-enqueue-idle-input (list "server list\n" 'ignore)) |
141 (gdb-instance-enqueue-idle-input (list "server info source\n" | 141 (gdb-instance-enqueue-idle-input (list "server info source\n" |
142 'gdb-source-info))) | 142 'gdb-source-info))) |
143 | 143 |
144 (defun gud-break (arg) | 144 (defun gud-break (arg) |
145 "Set breakpoint at current line or address." | 145 "Set breakpoint at current line or address." |
146 (interactive "p") | 146 (interactive "p") |
147 (if (not (string-equal mode-name "Assembler")) | 147 (if (not (string-equal mode-name "Assembler")) |
148 (gud-call "break %f:%l" arg) | 148 (gud-call "break %f:%l" arg) |
149 ;else | |
150 (save-excursion | 149 (save-excursion |
151 (beginning-of-line) | 150 (beginning-of-line) |
152 (forward-char 2) | 151 (forward-char 2) |
153 (gud-call "break *%a" arg)))) | 152 (gud-call "break *%a" arg)))) |
154 | 153 |
155 (defun gud-remove (arg) | 154 (defun gud-remove (arg) |
156 "Remove breakpoint at current line or address." | 155 "Remove breakpoint at current line or address." |
157 (interactive "p") | 156 (interactive "p") |
158 (if (not (string-equal mode-name "Assembler")) | 157 (if (not (string-equal mode-name "Assembler")) |
159 (gud-call "clear %f:%l" arg) | 158 (gud-call "clear %f:%l" arg) |
160 ;else | |
161 (save-excursion | 159 (save-excursion |
162 (beginning-of-line) | 160 (beginning-of-line) |
163 (forward-char 2) | 161 (forward-char 2) |
164 (gud-call "clear *%a" arg)))) | 162 (gud-call "clear *%a" arg)))) |
165 | 163 |
175 (defun gud-display1 (expr) | 173 (defun gud-display1 (expr) |
176 (goto-char (point-min)) | 174 (goto-char (point-min)) |
177 (if (re-search-forward "\*" nil t) | 175 (if (re-search-forward "\*" nil t) |
178 (gdb-instance-enqueue-idle-input | 176 (gdb-instance-enqueue-idle-input |
179 (list (concat "server display* " expr "\n") 'ignore)) | 177 (list (concat "server display* " expr "\n") 'ignore)) |
180 ;else | |
181 (gdb-instance-enqueue-idle-input | 178 (gdb-instance-enqueue-idle-input |
182 (list (concat "server display " expr "\n") 'ignore)))) | 179 (list (concat "server display " expr "\n") 'ignore)))) |
183 | 180 |
184 | 181 |
185 ;; The completion process filter is installed temporarily to slurp the | 182 ;; The completion process filter is installed temporarily to slurp the |
442 (setcdr binding rules) | 439 (setcdr binding rules) |
443 (setq gdb-instance-buffer-rules-assoc | 440 (setq gdb-instance-buffer-rules-assoc |
444 (cons (cons buffer-type rules) | 441 (cons (cons buffer-type rules) |
445 gdb-instance-buffer-rules-assoc))))) | 442 gdb-instance-buffer-rules-assoc))))) |
446 | 443 |
447 ; GUD buffers are an exception to the rules | 444 ;; GUD buffers are an exception to the rules |
448 (gdb-set-instance-buffer-rules 'gdba 'error) | 445 (gdb-set-instance-buffer-rules 'gdba 'error) |
449 | 446 |
450 ;; | 447 ;; |
451 ;; partial-output buffers | 448 ;; partial-output buffers |
452 ;; | 449 ;; |
596 (let ((answer (car queue))) | 593 (let ((answer (car queue))) |
597 (set-gdb-instance-idle-input-queue '()) | 594 (set-gdb-instance-idle-input-queue '()) |
598 answer) | 595 answer) |
599 (gdb-take-last-elt queue))))) | 596 (gdb-take-last-elt queue))))) |
600 | 597 |
601 ; Don't use this in general. | 598 ;; Don't use this in general. |
602 (defun gdb-take-last-elt (l) | 599 (defun gdb-take-last-elt (l) |
603 (if (cdr (cdr l)) | 600 (if (cdr (cdr l)) |
604 (gdb-take-last-elt (cdr l)) | 601 (gdb-take-last-elt (cdr l)) |
605 (let ((answer (car (cdr l)))) | 602 (let ((answer (car (cdr l)))) |
606 (setcdr l '()) | 603 (setcdr l '()) |
655 ("display-begin" gdb-display-begin) | 652 ("display-begin" gdb-display-begin) |
656 ("display-end" gdb-display-end) | 653 ("display-end" gdb-display-end) |
657 ("display-number-end" gdb-display-number-end) | 654 ("display-number-end" gdb-display-number-end) |
658 ("array-section-begin" gdb-array-section-begin) | 655 ("array-section-begin" gdb-array-section-begin) |
659 ("array-section-end" gdb-array-section-end) | 656 ("array-section-end" gdb-array-section-end) |
660 ; ("elt" gdb-elt) | 657 ;; ("elt" gdb-elt) |
661 ("field-begin" gdb-field-begin) | 658 ("field-begin" gdb-field-begin) |
662 ("field-end" gdb-field-end) | 659 ("field-end" gdb-field-end) |
663 ) "An assoc mapping annotation tags to functions which process them.") | 660 ) "An assoc mapping annotation tags to functions which process them.") |
664 | 661 |
665 (defun gdb-ignore-annotation (args) | 662 (defun gdb-ignore-annotation (args) |
676 (cons | 673 (cons |
677 (match-string 1 args) | 674 (match-string 1 args) |
678 (string-to-int (match-string 2 args)))) | 675 (string-to-int (match-string 2 args)))) |
679 (setq gdb-current-address (match-string 3 args)) | 676 (setq gdb-current-address (match-string 3 args)) |
680 (setq gdb-main-or-pc gdb-current-address) | 677 (setq gdb-main-or-pc gdb-current-address) |
681 ;update with new frame for machine code if necessary | 678 ;;update with new frame for machine code if necessary |
682 (gdb-invalidate-assembler)) | 679 (gdb-invalidate-assembler)) |
683 | 680 |
684 (defun gdb-prompt (ignored) | 681 (defun gdb-prompt (ignored) |
685 "An annotation handler for `prompt'. | 682 "An annotation handler for `prompt'. |
686 This sends the next command (if any) to gdb." | 683 This sends the next command (if any) to gdb." |
858 (goto-char (point-min)) | 855 (goto-char (point-min)) |
859 (search-forward ": ") | 856 (search-forward ": ") |
860 (looking-at "\\(.*?\\) =") | 857 (looking-at "\\(.*?\\) =") |
861 (let ((char "") | 858 (let ((char "") |
862 (gdb-temp-value (match-string 1))) | 859 (gdb-temp-value (match-string 1))) |
863 ;move * to front of expression if necessary | 860 ;;move * to front of expression if necessary |
864 (if (looking-at ".*\\*") | 861 (if (looking-at ".*\\*") |
865 (progn | 862 (progn |
866 (setq char "*") | 863 (setq char "*") |
867 (setq gdb-temp-value (substring gdb-temp-value 1 nil)))) | 864 (setq gdb-temp-value (substring gdb-temp-value 1 nil)))) |
868 (save-excursion | 865 (save-excursion |
869 (set-buffer gdb-expression-buffer-name) | 866 (set-buffer gdb-expression-buffer-name) |
870 (setq gdb-expression gdb-temp-value) | 867 (setq gdb-expression gdb-temp-value) |
871 (if (not (string-match "::" gdb-expression)) | 868 (if (not (string-match "::" gdb-expression)) |
872 (setq gdb-expression (concat char gdb-current-frame | 869 (setq gdb-expression (concat char gdb-current-frame |
873 "::" gdb-expression)) | 870 "::" gdb-expression)) |
874 ;else put * back on if necessary | 871 ;;else put * back on if necessary |
875 (setq gdb-expression (concat char gdb-expression))) | 872 (setq gdb-expression (concat char gdb-expression))) |
876 (setq header-line-format (concat "-- " gdb-expression " %-")))) | 873 (setq header-line-format (concat "-- " gdb-expression " %-")))) |
877 | 874 |
878 ;-if scalar/string | 875 ;;-if scalar/string |
879 (if (not (re-search-forward "##" nil t)) | 876 (if (not (re-search-forward "##" nil t)) |
880 (progn | 877 (progn |
881 (save-excursion | 878 (save-excursion |
882 (set-buffer gdb-expression-buffer-name) | 879 (set-buffer gdb-expression-buffer-name) |
883 (setq buffer-read-only nil) | 880 (setq buffer-read-only nil) |
884 (delete-region (point-min) (point-max)) | 881 (delete-region (point-min) (point-max)) |
885 (insert-buffer (gdb-get-instance-buffer 'gdb-partial-output-buffer)) | 882 (insert-buffer (gdb-get-instance-buffer 'gdb-partial-output-buffer)) |
886 (setq buffer-read-only t))) | 883 (setq buffer-read-only t))) |
887 ; else | 884 ;; display expression name... |
888 ; display expression name... | |
889 (goto-char (point-min)) | 885 (goto-char (point-min)) |
890 (let ((start (progn (point))) | 886 (let ((start (progn (point))) |
891 (end (progn (end-of-line) (point)))) | 887 (end (progn (end-of-line) (point)))) |
892 (save-excursion | 888 (save-excursion |
893 (set-buffer gdb-expression-buffer-name) | 889 (set-buffer gdb-expression-buffer-name) |
925 (define-button-type 'gdb-display-back | 921 (define-button-type 'gdb-display-back |
926 'help-echo (purecopy "mouse-2, RET: go back to previous display buffer") | 922 'help-echo (purecopy "mouse-2, RET: go back to previous display buffer") |
927 'action (lambda (button) (gdb-display-go-back))) | 923 'action (lambda (button) (gdb-display-go-back))) |
928 | 924 |
929 (defun gdb-display-go-back () | 925 (defun gdb-display-go-back () |
930 ; delete display so they don't accumulate and delete buffer | 926 ;; delete display so they don't accumulate and delete buffer |
931 (let ((number gdb-display-number)) | 927 (let ((number gdb-display-number)) |
932 (gdb-instance-enqueue-idle-input | 928 (gdb-instance-enqueue-idle-input |
933 (list (concat "server delete display " number "\n") 'ignore)) | 929 (list (concat "server delete display " number "\n") 'ignore)) |
934 (switch-to-buffer (concat "*display " gdb-dive-display-number "*")) | 930 (switch-to-buffer (concat "*display " gdb-dive-display-number "*")) |
935 (kill-buffer (get-buffer (concat "*display " number "*"))))) | 931 (kill-buffer (get-buffer (concat "*display " number "*"))))) |
936 | 932 |
937 ; prefix annotations with ## and process whole output in one chunk | 933 ;; prefix annotations with ## and process whole output in one chunk |
938 ; in gdb-partial-output-buffer (to allow recursion). | 934 ;; in gdb-partial-output-buffer (to allow recursion). |
939 | 935 |
940 ; array-section flags are just removed again but after counting. They | 936 ;; array-section flags are just removed again but after counting. They |
941 ; might also be useful for arrays of structures and structures with arrays. | 937 ;; might also be useful for arrays of structures and structures with arrays. |
942 (defun gdb-array-section-begin (args) | 938 (defun gdb-array-section-begin (args) |
943 (if gdb-display-in-progress | 939 (if gdb-display-in-progress |
944 (progn | 940 (progn |
945 (save-excursion | 941 (save-excursion |
946 (set-buffer (gdb-get-instance-buffer 'gdb-partial-output-buffer)) | 942 (set-buffer (gdb-get-instance-buffer 'gdb-partial-output-buffer)) |
976 (progn | 972 (progn |
977 (goto-char (point-max)) | 973 (goto-char (point-max)) |
978 (insert "\n##elt\n")))) | 974 (insert "\n##elt\n")))) |
979 | 975 |
980 (defun gdb-field-format-begin () | 976 (defun gdb-field-format-begin () |
981 ; get rid of ##field-begin | 977 ;; get rid of ##field-begin |
982 (gdb-delete-line) | 978 (gdb-delete-line) |
983 (gdb-insert-field) | 979 (gdb-insert-field) |
984 (setq gdb-nesting-level (+ gdb-nesting-level 1)) | 980 (setq gdb-nesting-level (+ gdb-nesting-level 1)) |
985 (while (re-search-forward "##" nil t) | 981 (while (re-search-forward "##" nil t) |
986 ; keep making recursive calls... | 982 ;; keep making recursive calls... |
987 (if (looking-at "field-begin \\(.\\)") | 983 (if (looking-at "field-begin \\(.\\)") |
988 (progn | 984 (progn |
989 (setq gdb-annotation-arg (match-string 1)) | 985 (setq gdb-annotation-arg (match-string 1)) |
990 (gdb-field-format-begin))) | 986 (gdb-field-format-begin))) |
991 ; until field-end. | 987 ;; until field-end. |
992 (if (looking-at "field-end") (gdb-field-format-end)))) | 988 (if (looking-at "field-end") (gdb-field-format-end)))) |
993 | 989 |
994 (defun gdb-field-format-end () | 990 (defun gdb-field-format-end () |
995 ; get rid of ##field-end and `,' or `}' | 991 ;; get rid of ##field-end and `,' or `}' |
996 (gdb-delete-line) | 992 (gdb-delete-line) |
997 (gdb-delete-line) | 993 (gdb-delete-line) |
998 (setq gdb-nesting-level (- gdb-nesting-level 1))) | 994 (setq gdb-nesting-level (- gdb-nesting-level 1))) |
999 | 995 |
1000 (defvar gdb-dive-map | 996 (defvar gdb-dive-map |
1065 | 1061 |
1066 (defvar gdb-values) | 1062 (defvar gdb-values) |
1067 | 1063 |
1068 (defun gdb-array-format () | 1064 (defun gdb-array-format () |
1069 (while (re-search-forward "##" nil t) | 1065 (while (re-search-forward "##" nil t) |
1070 ; keep making recursive calls... | 1066 ;; keep making recursive calls... |
1071 (if (looking-at "array-section-begin") | 1067 (if (looking-at "array-section-begin") |
1072 (progn | 1068 (progn |
1073 ;get rid of ##array-section-begin | 1069 ;;get rid of ##array-section-begin |
1074 (gdb-delete-line) | 1070 (gdb-delete-line) |
1075 (setq gdb-nesting-level (+ gdb-nesting-level 1)) | 1071 (setq gdb-nesting-level (+ gdb-nesting-level 1)) |
1076 (gdb-array-format))) | 1072 (gdb-array-format))) |
1077 ;until *matching* array-section-end is found | 1073 ;;until *matching* array-section-end is found |
1078 (if (looking-at "array-section-end") | 1074 (if (looking-at "array-section-end") |
1079 (if (eq gdb-nesting-level 0) | 1075 (if (eq gdb-nesting-level 0) |
1080 (progn | 1076 (progn |
1081 (let ((values (buffer-substring gdb-point (- (point) 2)))) | 1077 (let ((values (buffer-substring gdb-point (- (point) 2)))) |
1082 (save-excursion | 1078 (save-excursion |
1083 (set-buffer gdb-expression-buffer-name) | 1079 (set-buffer gdb-expression-buffer-name) |
1084 (setq gdb-values | 1080 (setq gdb-values |
1085 (concat "{" (replace-regexp-in-string "\n" "" values) | 1081 (concat "{" (replace-regexp-in-string "\n" "" values) |
1086 "}")) | 1082 "}")) |
1087 (gdb-array-format1)))) | 1083 (gdb-array-format1)))) |
1088 ;else get rid of ##array-section-end etc | 1084 ;;else get rid of ##array-section-end etc |
1089 (gdb-delete-line) | 1085 (gdb-delete-line) |
1090 (setq gdb-nesting-level (- gdb-nesting-level 1)) | 1086 (setq gdb-nesting-level (- gdb-nesting-level 1)) |
1091 (gdb-array-format))))) | 1087 (gdb-array-format))))) |
1092 | 1088 |
1093 (defvar gdb-array-start) | 1089 (defvar gdb-array-start) |
1398 | 1394 |
1399 (defvar gdb-cdir nil "Compilation directory.") | 1395 (defvar gdb-cdir nil "Compilation directory.") |
1400 (defvar breakpoint-enabled-icon) | 1396 (defvar breakpoint-enabled-icon) |
1401 (defvar breakpoint-disabled-icon) | 1397 (defvar breakpoint-disabled-icon) |
1402 | 1398 |
1403 ;-put breakpoint icons in relevant margins (even those set in the GUD buffer) | 1399 ;;-put breakpoint icons in relevant margins (even those set in the GUD buffer) |
1404 (defun gdb-info-breakpoints-custom () | 1400 (defun gdb-info-breakpoints-custom () |
1405 (let ((flag)(address)) | 1401 (let ((flag)(address)) |
1406 | 1402 |
1407 ;; remove all breakpoint-icons in source buffers but not assembler buffer | 1403 ;; remove all breakpoint-icons in source buffers but not assembler buffer |
1408 (let ((buffers (buffer-list))) | 1404 (let ((buffers (buffer-list))) |
1704 "server info locals\n" | 1700 "server info locals\n" |
1705 gdb-info-locals-handler | 1701 gdb-info-locals-handler |
1706 gdb-info-locals-custom) | 1702 gdb-info-locals-custom) |
1707 | 1703 |
1708 | 1704 |
1709 ;Abbreviate for arrays and structures. These can be expanded using gud-display | 1705 ;;Abbreviate for arrays and structures. These can be expanded using gud-display |
1710 (defun gdb-info-locals-handler nil | 1706 (defun gdb-info-locals-handler nil |
1711 (set-gdb-instance-pending-triggers (delq 'gdb-invalidate-locals | 1707 (set-gdb-instance-pending-triggers (delq 'gdb-invalidate-locals |
1712 (gdb-instance-pending-triggers))) | 1708 (gdb-instance-pending-triggers))) |
1713 (let ((buf (gdb-get-instance-buffer 'gdb-partial-output-buffer))) | 1709 (let ((buf (gdb-get-instance-buffer 'gdb-partial-output-buffer))) |
1714 (save-excursion | 1710 (save-excursion |
1781 "server info display\n" | 1777 "server info display\n" |
1782 gdb-info-display-handler | 1778 gdb-info-display-handler |
1783 gdb-info-display-custom) | 1779 gdb-info-display-custom) |
1784 | 1780 |
1785 (defun gdb-info-display-custom () | 1781 (defun gdb-info-display-custom () |
1786 ; TODO: ensure frames of expressions that have been deleted are also deleted | 1782 ;; TODO: ensure frames of expressions that have been deleted are also deleted |
1787 ; these can be missed currently eg through GUD buffer, restarting a | 1783 ;; these can be missed currently eg through GUD buffer, restarting a |
1788 ; recompiled program. | 1784 ;; recompiled program. |
1789 ) | 1785 ) |
1790 | 1786 |
1791 (defvar gdb-display-mode-map | 1787 (defvar gdb-display-mode-map |
1792 (let ((map (make-sparse-keymap)) | 1788 (let ((map (make-sparse-keymap)) |
1793 (menu (make-sparse-keymap "Display"))) | 1789 (menu (make-sparse-keymap "Display"))) |
1794 (define-key menu [toggle] '("Toggle" . gdb-toggle-disp-this-line)) | 1790 (define-key menu [toggle] '("Toggle" . gdb-toggle-disp-this-line)) |
1857 (gdb-instance-enqueue-idle-input | 1853 (gdb-instance-enqueue-idle-input |
1858 (list (concat "server delete display " number "\n") | 1854 (list (concat "server delete display " number "\n") |
1859 'ignore)) | 1855 'ignore)) |
1860 (if (not (display-graphic-p)) | 1856 (if (not (display-graphic-p)) |
1861 (kill-buffer (get-buffer (concat "*display " number "*"))) | 1857 (kill-buffer (get-buffer (concat "*display " number "*"))) |
1862 ;else | |
1863 (catch 'frame-found | 1858 (catch 'frame-found |
1864 (let ((frames (frame-list))) | 1859 (let ((frames (frame-list))) |
1865 (while frames | 1860 (while frames |
1866 (if (string-equal (frame-parameter (car frames) 'name) | 1861 (if (string-equal (frame-parameter (car frames) 'name) |
1867 (concat "*display " number "*")) | 1862 (concat "*display " number "*")) |
2042 (if gdb-many-windows | 2037 (if gdb-many-windows |
2043 (progn | 2038 (progn |
2044 (switch-to-buffer gud-comint-buffer) | 2039 (switch-to-buffer gud-comint-buffer) |
2045 (delete-other-windows) | 2040 (delete-other-windows) |
2046 (gdb-setup-windows)) | 2041 (gdb-setup-windows)) |
2047 ;else | |
2048 (switch-to-buffer gud-comint-buffer) | 2042 (switch-to-buffer gud-comint-buffer) |
2049 (delete-other-windows) | 2043 (delete-other-windows) |
2050 (split-window) | 2044 (split-window) |
2051 (other-window 1) | 2045 (other-window 1) |
2052 (switch-to-buffer | 2046 (switch-to-buffer |
2138 (other-window 1) | 2132 (other-window 1) |
2139 (switch-to-buffer (gud-find-file gdb-main-file)) | 2133 (switch-to-buffer (gud-find-file gdb-main-file)) |
2140 (other-window 1) | 2134 (other-window 1) |
2141 (setq gdb-source-window (get-buffer-window (current-buffer)))))) | 2135 (setq gdb-source-window (get-buffer-window (current-buffer)))))) |
2142 | 2136 |
2143 ;from put-image | 2137 ;;from put-image |
2144 (defun put-string (putstring pos &optional string area) | 2138 (defun put-string (putstring pos &optional string area) |
2145 "Put string PUTSTRING in front of POS in the current buffer. | 2139 "Put string PUTSTRING in front of POS in the current buffer. |
2146 PUTSTRING is displayed by putting an overlay into the current buffer with a | 2140 PUTSTRING is displayed by putting an overlay into the current buffer with a |
2147 `before-string' STRING that has a `display' property whose value is | 2141 `before-string' STRING that has a `display' property whose value is |
2148 PUTSTRING. STRING is defaulted if you omit it. | 2142 PUTSTRING. STRING is defaulted if you omit it. |
2160 (prop (if (null area) putstring (list (list 'margin area) putstring)))) | 2154 (prop (if (null area) putstring (list (list 'margin area) putstring)))) |
2161 (put-text-property 0 (length string) 'display prop string) | 2155 (put-text-property 0 (length string) 'display prop string) |
2162 (overlay-put overlay 'put-text t) | 2156 (overlay-put overlay 'put-text t) |
2163 (overlay-put overlay 'before-string string)))) | 2157 (overlay-put overlay 'before-string string)))) |
2164 | 2158 |
2165 ;from remove-images | 2159 ;;from remove-images |
2166 (defun remove-strings (start end &optional buffer) | 2160 (defun remove-strings (start end &optional buffer) |
2167 "Remove strings between START and END in BUFFER. | 2161 "Remove strings between START and END in BUFFER. |
2168 Remove only images that were put in BUFFER with calls to `put-string'. | 2162 Remove only images that were put in BUFFER with calls to `put-string'. |
2169 BUFFER nil or omitted means use the current buffer." | 2163 BUFFER nil or omitted means use the current buffer." |
2170 (unless buffer | 2164 (unless buffer |
2266 (goto-char (point-min)) | 2260 (goto-char (point-min)) |
2267 (re-search-forward gdb-current-address) | 2261 (re-search-forward gdb-current-address) |
2268 (setq gdb-arrow-position (point)) | 2262 (setq gdb-arrow-position (point)) |
2269 (put-arrow "=>" gdb-arrow-position nil 'left-margin)))) | 2263 (put-arrow "=>" gdb-arrow-position nil 'left-margin)))) |
2270 | 2264 |
2271 ; remove all breakpoint-icons in assembler buffer before updating. | 2265 ;; remove all breakpoint-icons in assembler buffer before updating. |
2272 (save-excursion | 2266 (save-excursion |
2273 (set-buffer buffer) | 2267 (set-buffer buffer) |
2274 (if (display-graphic-p) | 2268 (if (display-graphic-p) |
2275 (remove-images (point-min) (point-max)) | 2269 (remove-images (point-min) (point-max)) |
2276 (remove-strings (point-min) (point-max)))) | 2270 (remove-strings (point-min) (point-max)))) |
2281 (forward-line 1) | 2275 (forward-line 1) |
2282 (if (looking-at "[^\t].*breakpoint") | 2276 (if (looking-at "[^\t].*breakpoint") |
2283 (progn | 2277 (progn |
2284 (looking-at | 2278 (looking-at |
2285 "\\([0-9]*\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*0x0\\(\\S-*\\)") | 2279 "\\([0-9]*\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*0x0\\(\\S-*\\)") |
2286 ; info break gives '0x0' (8 digit) while dump gives '0x' (7 digit) | 2280 ;; info break gives '0x0' (8 digit) while dump gives '0x' (7 digit) |
2287 (setq address (concat "0x" (match-string 3))) | 2281 (setq address (concat "0x" (match-string 3))) |
2288 (setq flag (char-after (match-beginning 2))) | 2282 (setq flag (char-after (match-beginning 2))) |
2289 (save-excursion | 2283 (save-excursion |
2290 (set-buffer buffer) | 2284 (set-buffer buffer) |
2291 (goto-char (point-min)) | 2285 (goto-char (point-min)) |
2356 (gdb-invalidate-breakpoints) | 2350 (gdb-invalidate-breakpoints) |
2357 (gdb-invalidate-assembler)) | 2351 (gdb-invalidate-assembler)) |
2358 | 2352 |
2359 (defvar gdb-prev-main-or-pc nil) | 2353 (defvar gdb-prev-main-or-pc nil) |
2360 | 2354 |
2361 ; modified because if gdb-main-or-pc has changed value a new command | 2355 ;; modified because if gdb-main-or-pc has changed value a new command |
2362 ; must be enqueued to update the buffer with the new output | 2356 ;; must be enqueued to update the buffer with the new output |
2363 (defun gdb-invalidate-assembler (&optional ignored) | 2357 (defun gdb-invalidate-assembler (&optional ignored) |
2364 (if (and (gdb-get-instance-buffer 'gdb-assembler-buffer) | 2358 (if (and (gdb-get-instance-buffer 'gdb-assembler-buffer) |
2365 (or (not (member 'gdb-invalidate-assembler | 2359 (or (not (member 'gdb-invalidate-assembler |
2366 (gdb-instance-pending-triggers))) | 2360 (gdb-instance-pending-triggers))) |
2367 (not (string-equal gdb-main-or-pc gdb-prev-main-or-pc)))) | 2361 (not (string-equal gdb-main-or-pc gdb-prev-main-or-pc)))) |