diff options
| author | Stefan Monnier | 2002-12-03 22:24:21 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-12-03 22:24:21 +0000 |
| commit | e0823361bc46fc7ee263071b2964c6194b4772d6 (patch) | |
| tree | 4acb04be005b72702879409969a7161dbda0d936 | |
| parent | 65d7dd2e57b1f7b55d470d906ae2e70bdd2f4edf (diff) | |
| download | emacs-e0823361bc46fc7ee263071b2964c6194b4772d6.tar.gz emacs-e0823361bc46fc7ee263071b2964c6194b4772d6.zip | |
Get rid of (quote ..); use match-string and ignore.
| -rw-r--r-- | lisp/gdb-ui.el | 229 |
1 files changed, 94 insertions, 135 deletions
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el index e7d5b55a3bc..47bde89c63e 100644 --- a/lisp/gdb-ui.el +++ b/lisp/gdb-ui.el | |||
| @@ -137,10 +137,9 @@ The following interactive lisp functions help control operation : | |||
| 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" | 140 | (gdb-instance-enqueue-idle-input (list "server list\n" 'ignore)) |
| 141 | '(lambda () nil))) | ||
| 142 | (gdb-instance-enqueue-idle-input (list "server info source\n" | 141 | (gdb-instance-enqueue-idle-input (list "server info source\n" |
| 143 | '(lambda () (gdb-source-info))))) | 142 | 'gdb-source-info))) |
| 144 | 143 | ||
| 145 | (defun gud-break (arg) | 144 | (defun gud-break (arg) |
| 146 | "Set breakpoint at current line or address." | 145 | "Set breakpoint at current line or address." |
| @@ -177,12 +176,10 @@ The following interactive lisp functions help control operation : | |||
| 177 | (goto-char (point-min)) | 176 | (goto-char (point-min)) |
| 178 | (if (re-search-forward "\*" nil t) | 177 | (if (re-search-forward "\*" nil t) |
| 179 | (gdb-instance-enqueue-idle-input | 178 | (gdb-instance-enqueue-idle-input |
| 180 | (list (concat "server display* " expr "\n") | 179 | (list (concat "server display* " expr "\n") 'ignore)) |
| 181 | '(lambda () nil))) | ||
| 182 | ;else | 180 | ;else |
| 183 | (gdb-instance-enqueue-idle-input | 181 | (gdb-instance-enqueue-idle-input |
| 184 | (list (concat "server display " expr "\n") | 182 | (list (concat "server display " expr "\n") 'ignore)))) |
| 185 | '(lambda () nil))))) | ||
| 186 | 183 | ||
| 187 | 184 | ||
| 188 | ;; The completion process filter is installed temporarily to slurp the | 185 | ;; The completion process filter is installed temporarily to slurp the |
| @@ -677,12 +674,9 @@ This filter may simply queue output for a later time." | |||
| 677 | ;; Extract the frame position from the marker. | 674 | ;; Extract the frame position from the marker. |
| 678 | (setq gud-last-frame | 675 | (setq gud-last-frame |
| 679 | (cons | 676 | (cons |
| 680 | (substring args (match-beginning 1) (match-end 1)) | 677 | (match-string 1 args) |
| 681 | (string-to-int (substring args | 678 | (string-to-int (match-string 2 args)))) |
| 682 | (match-beginning 2) | 679 | (setq gdb-current-address (match-string 3 args)) |
| 683 | (match-end 2))))) | ||
| 684 | (setq gdb-current-address (substring args (match-beginning 3) | ||
| 685 | (match-end 3))) | ||
| 686 | (setq gdb-main-or-pc gdb-current-address) | 680 | (setq gdb-main-or-pc gdb-current-address) |
| 687 | ;update with new frame for machine code if necessary | 681 | ;update with new frame for machine code if necessary |
| 688 | (gdb-invalidate-assembler)) | 682 | (gdb-invalidate-assembler)) |
| @@ -866,8 +860,7 @@ output from the current command if that happens to be appropriate." | |||
| 866 | (search-forward ": ") | 860 | (search-forward ": ") |
| 867 | (looking-at "\\(.*?\\) =") | 861 | (looking-at "\\(.*?\\) =") |
| 868 | (let ((char "") | 862 | (let ((char "") |
| 869 | (gdb-temp-value (buffer-substring (match-beginning 1) | 863 | (gdb-temp-value (match-string 1))) |
| 870 | (match-end 1)))) | ||
| 871 | ;move * to front of expression if necessary | 864 | ;move * to front of expression if necessary |
| 872 | (if (looking-at ".*\\*") | 865 | (if (looking-at ".*\\*") |
| 873 | (progn | 866 | (progn |
| @@ -916,8 +909,7 @@ output from the current command if that happens to be appropriate." | |||
| 916 | (gdb-array-format))) | 909 | (gdb-array-format))) |
| 917 | (if (looking-at "field-begin \\(.\\)") | 910 | (if (looking-at "field-begin \\(.\\)") |
| 918 | (progn | 911 | (progn |
| 919 | (setq gdb-annotation-arg (buffer-substring (match-beginning 1) | 912 | (setq gdb-annotation-arg (match-string 1)) |
| 920 | (match-end 1))) | ||
| 921 | (gdb-field-format-begin)))) | 913 | (gdb-field-format-begin)))) |
| 922 | (save-excursion | 914 | (save-excursion |
| 923 | (set-buffer gdb-expression-buffer-name) | 915 | (set-buffer gdb-expression-buffer-name) |
| @@ -940,8 +932,7 @@ output from the current command if that happens to be appropriate." | |||
| 940 | ; delete display so they don't accumulate and delete buffer | 932 | ; delete display so they don't accumulate and delete buffer |
| 941 | (let ((number gdb-display-number)) | 933 | (let ((number gdb-display-number)) |
| 942 | (gdb-instance-enqueue-idle-input | 934 | (gdb-instance-enqueue-idle-input |
| 943 | (list (concat "server delete display " number "\n") | 935 | (list (concat "server delete display " number "\n") 'ignore)) |
| 944 | '(lambda () nil))) | ||
| 945 | (switch-to-buffer (concat "*display " gdb-dive-display-number "*")) | 936 | (switch-to-buffer (concat "*display " gdb-dive-display-number "*")) |
| 946 | (kill-buffer (get-buffer (concat "*display " number "*"))))) | 937 | (kill-buffer (get-buffer (concat "*display " number "*"))))) |
| 947 | 938 | ||
| @@ -997,8 +988,7 @@ output from the current command if that happens to be appropriate." | |||
| 997 | ; keep making recursive calls... | 988 | ; keep making recursive calls... |
| 998 | (if (looking-at "field-begin \\(.\\)") | 989 | (if (looking-at "field-begin \\(.\\)") |
| 999 | (progn | 990 | (progn |
| 1000 | (setq gdb-annotation-arg (buffer-substring (match-beginning 1) | 991 | (setq gdb-annotation-arg (match-string 1)) |
| 1001 | (match-end 1))) | ||
| 1002 | (gdb-field-format-begin))) | 992 | (gdb-field-format-begin))) |
| 1003 | ; until field-end. | 993 | ; until field-end. |
| 1004 | (if (looking-at "field-end") (gdb-field-format-end)))) | 994 | (if (looking-at "field-end") (gdb-field-format-end)))) |
| @@ -1032,9 +1022,7 @@ output from the current command if that happens to be appropriate." | |||
| 1032 | (beginning-of-line) | 1022 | (beginning-of-line) |
| 1033 | (if (looking-at "\*") (setq gdb-display-char "*")) | 1023 | (if (looking-at "\*") (setq gdb-display-char "*")) |
| 1034 | (re-search-forward "\\(\\S-+\\) = " end t) | 1024 | (re-search-forward "\\(\\S-+\\) = " end t) |
| 1035 | (setq gdb-last-field (buffer-substring-no-properties | 1025 | (setq gdb-last-field (match-string-no-properties 1)) |
| 1036 | (match-beginning 1) | ||
| 1037 | (match-end 1))) | ||
| 1038 | (goto-char (match-beginning 1)) | 1026 | (goto-char (match-beginning 1)) |
| 1039 | (let ((last-column (current-column))) | 1027 | (let ((last-column (current-column))) |
| 1040 | (while (re-search-backward "\\s-\\(\\S-+\\) = {" nil t) | 1028 | (while (re-search-backward "\\s-\\(\\S-+\\) = {" nil t) |
| @@ -1043,19 +1031,18 @@ output from the current command if that happens to be appropriate." | |||
| 1043 | (> (count-lines 1 (point)) 1)) | 1031 | (> (count-lines 1 (point)) 1)) |
| 1044 | (progn | 1032 | (progn |
| 1045 | (setq gdb-part-expression | 1033 | (setq gdb-part-expression |
| 1046 | (concat "." (buffer-substring-no-properties | 1034 | (concat "." (match-string-no-properties 1) |
| 1047 | (match-beginning 1) | 1035 | gdb-part-expression)) |
| 1048 | (match-end 1)) gdb-part-expression)) | ||
| 1049 | (setq last-column (current-column)))))) | 1036 | (setq last-column (current-column)))))) |
| 1050 | ; * not needed for components of a pointer to a structure in gdb | 1037 | ;; * not needed for components of a pointer to a structure in gdb |
| 1051 | (if (string-equal "*" (substring gdb-full-expression 0 1)) | 1038 | (if (string-equal "*" (substring gdb-full-expression 0 1)) |
| 1052 | (setq gdb-full-expression (substring gdb-full-expression 1 nil))) | 1039 | (setq gdb-full-expression (substring gdb-full-expression 1 nil))) |
| 1053 | (setq gdb-full-expression | 1040 | (setq gdb-full-expression |
| 1054 | (concat gdb-full-expression gdb-part-expression "." gdb-last-field)) | 1041 | (concat gdb-full-expression gdb-part-expression "." gdb-last-field)) |
| 1055 | (gdb-instance-enqueue-idle-input (list | 1042 | (gdb-instance-enqueue-idle-input |
| 1056 | (concat "server display" gdb-display-char | 1043 | (list (concat "server display" gdb-display-char |
| 1057 | " " gdb-full-expression "\n") | 1044 | " " gdb-full-expression "\n") |
| 1058 | '(lambda () nil)))))) | 1045 | 'ignore))))) |
| 1059 | 1046 | ||
| 1060 | (defun gdb-insert-field () | 1047 | (defun gdb-insert-field () |
| 1061 | (let ((start (progn (point))) | 1048 | (let ((start (progn (point))) |
| @@ -1155,9 +1142,7 @@ output from the current command if that happens to be appropriate." | |||
| 1155 | (aset gdb-array-size num (aref indices num))) | 1142 | (aset gdb-array-size num (aref indices num))) |
| 1156 | (setq num (+ num 1))) | 1143 | (setq num (+ num 1))) |
| 1157 | (if flag | 1144 | (if flag |
| 1158 | (let ((gdb-display-value (substring (car gdb-value-list) | 1145 | (let ((gdb-display-value (match-string 1 (car gdb-value-list)))) |
| 1159 | (match-beginning 1) | ||
| 1160 | (match-end 1)))) | ||
| 1161 | (setq gdb-display-string (concat gdb-display-string " " | 1146 | (setq gdb-display-string (concat gdb-display-string " " |
| 1162 | gdb-display-value)) | 1147 | gdb-display-value)) |
| 1163 | (insert | 1148 | (insert |
| @@ -1226,9 +1211,7 @@ buffer." | |||
| 1226 | 1211 | ||
| 1227 | ;; Process all the complete markers in this chunk. | 1212 | ;; Process all the complete markers in this chunk. |
| 1228 | (while (string-match "\n\032\032\\(.*\\)\n" burst) | 1213 | (while (string-match "\n\032\032\\(.*\\)\n" burst) |
| 1229 | (let ((annotation (substring burst | 1214 | (let ((annotation (match-string 1 burst))) |
| 1230 | (match-beginning 1) | ||
| 1231 | (match-end 1)))) | ||
| 1232 | 1215 | ||
| 1233 | ;; Stuff prior to the match is just ordinary output. | 1216 | ;; Stuff prior to the match is just ordinary output. |
| 1234 | ;; It is either concatenated to OUTPUT or directed | 1217 | ;; It is either concatenated to OUTPUT or directed |
| @@ -1243,12 +1226,8 @@ buffer." | |||
| 1243 | 1226 | ||
| 1244 | ;; Parse the tag from the annotation, and maybe its arguments. | 1227 | ;; Parse the tag from the annotation, and maybe its arguments. |
| 1245 | (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) | 1228 | (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) |
| 1246 | (let* ((annotation-type (substring annotation | 1229 | (let* ((annotation-type (match-string 1 annotation)) |
| 1247 | (match-beginning 1) | 1230 | (annotation-arguments (match-string 2 annotation)) |
| 1248 | (match-end 1))) | ||
| 1249 | (annotation-arguments (substring annotation | ||
| 1250 | (match-beginning 2) | ||
| 1251 | (match-end 2))) | ||
| 1252 | (annotation-rule (assoc annotation-type | 1231 | (annotation-rule (assoc annotation-type |
| 1253 | gdb-annotation-rules))) | 1232 | gdb-annotation-rules))) |
| 1254 | ;; Call the handler for this annotation. | 1233 | ;; Call the handler for this annotation. |
| @@ -1377,16 +1356,15 @@ buffer." | |||
| 1377 | (insert-buffer (gdb-get-create-instance-buffer | 1356 | (insert-buffer (gdb-get-create-instance-buffer |
| 1378 | 'gdb-partial-output-buffer)) | 1357 | 'gdb-partial-output-buffer)) |
| 1379 | (goto-char p))))) | 1358 | (goto-char p))))) |
| 1380 | ; put customisation here | 1359 | ;; put customisation here |
| 1381 | (,custom-defun))) | 1360 | (,custom-defun))) |
| 1382 | 1361 | ||
| 1383 | (defmacro def-gdb-auto-updated-buffer | 1362 | (defmacro def-gdb-auto-updated-buffer (buffer-key trigger-name gdb-command |
| 1384 | (buffer-key trigger-name gdb-command output-handler-name custom-defun) | 1363 | output-handler-name custom-defun) |
| 1385 | `(progn | 1364 | `(progn |
| 1386 | (def-gdb-auto-update-trigger ,trigger-name | 1365 | (def-gdb-auto-update-trigger ,trigger-name |
| 1387 | ;; The demand predicate: | 1366 | ;; The demand predicate: |
| 1388 | (lambda () | 1367 | (lambda () (gdb-get-instance-buffer ',buffer-key)) |
| 1389 | (gdb-get-instance-buffer ',buffer-key)) | ||
| 1390 | ,gdb-command | 1368 | ,gdb-command |
| 1391 | ,output-handler-name) | 1369 | ,output-handler-name) |
| 1392 | (def-gdb-auto-update-handler ,output-handler-name | 1370 | (def-gdb-auto-update-handler ,output-handler-name |
| @@ -1456,28 +1434,24 @@ buffer." | |||
| 1456 | (beginning-of-line) | 1434 | (beginning-of-line) |
| 1457 | (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+") | 1435 | (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+") |
| 1458 | (looking-at "\\(\\S-*\\):\\([0-9]+\\)") | 1436 | (looking-at "\\(\\S-*\\):\\([0-9]+\\)") |
| 1459 | (let ((line (buffer-substring (match-beginning 2) | 1437 | (let ((line (match-string 2)) |
| 1460 | (match-end 2))) | 1438 | (file (match-string 1))) |
| 1461 | (file (buffer-substring (match-beginning 1) | ||
| 1462 | (match-end 1)))) | ||
| 1463 | (save-excursion | 1439 | (save-excursion |
| 1464 | (set-buffer | 1440 | (set-buffer |
| 1465 | (if (file-exists-p file) | 1441 | (find-file-noselect (if (file-exists-p file) |
| 1466 | (find-file-noselect file) | 1442 | file |
| 1467 | ;else | 1443 | (expand-file-name file gdb-cdir)))) |
| 1468 | (find-file-noselect (concat gdb-cdir "/" file)))) | 1444 | (save-current-buffer |
| 1469 | (with-current-buffer (current-buffer) | 1445 | (set (make-local-variable 'gud-minor-mode) 'gdba) |
| 1470 | (progn | 1446 | (set (make-local-variable 'tool-bar-map) |
| 1471 | (set (make-local-variable 'gud-minor-mode) 'gdba) | 1447 | gud-tool-bar-map) |
| 1472 | (set (make-local-variable 'tool-bar-map) | 1448 | (setq left-margin-width 2) |
| 1473 | gud-tool-bar-map) | 1449 | (if (get-buffer-window (current-buffer)) |
| 1474 | (setq left-margin-width 2) | 1450 | (set-window-margins (get-buffer-window |
| 1475 | (if (get-buffer-window (current-buffer)) | 1451 | (current-buffer)) |
| 1476 | (set-window-margins (get-buffer-window | 1452 | left-margin-width |
| 1477 | (current-buffer)) | 1453 | right-margin-width))) |
| 1478 | left-margin-width | 1454 | ;; only want one breakpoint icon at each location |
| 1479 | right-margin-width)))) | ||
| 1480 | ; only want one breakpoint icon at each location | ||
| 1481 | (save-excursion | 1455 | (save-excursion |
| 1482 | (goto-line (string-to-number line)) | 1456 | (goto-line (string-to-number line)) |
| 1483 | (let ((start (progn (beginning-of-line) (- (point) 1))) | 1457 | (let ((start (progn (beginning-of-line) (- (point) 1))) |
| @@ -1557,10 +1531,9 @@ buffer." | |||
| 1557 | (if (eq ?y (char-after (match-beginning 2))) | 1531 | (if (eq ?y (char-after (match-beginning 2))) |
| 1558 | "server disable " | 1532 | "server disable " |
| 1559 | "server enable ") | 1533 | "server enable ") |
| 1560 | (buffer-substring (match-beginning 0) | 1534 | (match-string 1) |
| 1561 | (match-end 1)) | ||
| 1562 | "\n") | 1535 | "\n") |
| 1563 | '(lambda () nil)))))) | 1536 | 'ignore))))) |
| 1564 | 1537 | ||
| 1565 | (defun gdb-delete-bp-this-line () | 1538 | (defun gdb-delete-bp-this-line () |
| 1566 | "Delete the breakpoint on this line." | 1539 | "Delete the breakpoint on this line." |
| @@ -1572,10 +1545,9 @@ buffer." | |||
| 1572 | (list | 1545 | (list |
| 1573 | (concat | 1546 | (concat |
| 1574 | "server delete " | 1547 | "server delete " |
| 1575 | (buffer-substring (match-beginning 0) | 1548 | (match-string 1) |
| 1576 | (match-end 1)) | ||
| 1577 | "\n") | 1549 | "\n") |
| 1578 | '(lambda () nil))))) | 1550 | 'ignore)))) |
| 1579 | 1551 | ||
| 1580 | (defvar gdb-source-window nil) | 1552 | (defvar gdb-source-window nil) |
| 1581 | 1553 | ||
| @@ -1586,15 +1558,13 @@ buffer." | |||
| 1586 | (beginning-of-line 1) | 1558 | (beginning-of-line 1) |
| 1587 | (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+") | 1559 | (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+") |
| 1588 | (looking-at "\\(\\S-*\\):\\([0-9]+\\)")) | 1560 | (looking-at "\\(\\S-*\\):\\([0-9]+\\)")) |
| 1589 | (let ((line (buffer-substring (match-beginning 2) | 1561 | (let ((line (match-string 2)) |
| 1590 | (match-end 2))) | 1562 | (file (match-string 1))) |
| 1591 | (file (buffer-substring (match-beginning 1) | 1563 | (set-window-buffer gdb-source-window |
| 1592 | (match-end 1)))) | 1564 | (find-file-noselect |
| 1593 | (if (file-exists-p file) | 1565 | (if (file-exists-p file) |
| 1594 | (set-window-buffer gdb-source-window (find-file-noselect file)) | 1566 | file |
| 1595 | ;else | 1567 | (expand-file-name file gdb-cdir)))) |
| 1596 | (setq file (concat gdb-cdir "/" file)) | ||
| 1597 | (set-window-buffer gdb-source-window (find-file-noselect file))) | ||
| 1598 | (goto-line (string-to-number line)))) | 1568 | (goto-line (string-to-number line)))) |
| 1599 | 1569 | ||
| 1600 | ;; | 1570 | ;; |
| @@ -1620,7 +1590,7 @@ buffer." | |||
| 1620 | (let ((buffer-read-only nil)) | 1590 | (let ((buffer-read-only nil)) |
| 1621 | (goto-char (point-min)) | 1591 | (goto-char (point-min)) |
| 1622 | (looking-at "\\S-*\\s-*\\(\\S-*\\)") | 1592 | (looking-at "\\S-*\\s-*\\(\\S-*\\)") |
| 1623 | (setq gdb-current-frame (buffer-substring (match-beginning 1) (match-end 1))) | 1593 | (setq gdb-current-frame (match-string 1)) |
| 1624 | (while (< (point) (point-max)) | 1594 | (while (< (point) (point-max)) |
| 1625 | (put-text-property (progn (beginning-of-line) (point)) | 1595 | (put-text-property (progn (beginning-of-line) (point)) |
| 1626 | (progn (end-of-line) (point)) | 1596 | (progn (end-of-line) (point)) |
| @@ -1664,11 +1634,7 @@ buffer." | |||
| 1664 | (defun gdb-get-frame-number () | 1634 | (defun gdb-get-frame-number () |
| 1665 | (save-excursion | 1635 | (save-excursion |
| 1666 | (let* ((pos (re-search-backward "^#\\([0-9]*\\)" nil t)) | 1636 | (let* ((pos (re-search-backward "^#\\([0-9]*\\)" nil t)) |
| 1667 | (n (or (and pos | 1637 | (n (or (and pos (string-to-int (match-string 1))) 0))) |
| 1668 | (string-to-int | ||
| 1669 | (buffer-substring (match-beginning 1) | ||
| 1670 | (match-end 1)))) | ||
| 1671 | 0))) | ||
| 1672 | n))) | 1638 | n))) |
| 1673 | 1639 | ||
| 1674 | (defun gdb-frames-select-by-mouse (e) | 1640 | (defun gdb-frames-select-by-mouse (e) |
| @@ -1684,11 +1650,9 @@ buffer." | |||
| 1684 | (save-excursion | 1650 | (save-excursion |
| 1685 | (set-buffer (gdb-get-instance-buffer 'gdba)) | 1651 | (set-buffer (gdb-get-instance-buffer 'gdba)) |
| 1686 | (gdb-instance-enqueue-idle-input | 1652 | (gdb-instance-enqueue-idle-input |
| 1687 | (list | 1653 | (list (gud-format-command "server frame %p\n" selection) |
| 1688 | (concat (gud-format-command "server frame %p" selection) | 1654 | 'ignore)) |
| 1689 | "\n") | 1655 | (gud-display-frame)))) |
| 1690 | '(lambda () nil))) | ||
| 1691 | (gud-display-frame)))) | ||
| 1692 | 1656 | ||
| 1693 | 1657 | ||
| 1694 | ;; | 1658 | ;; |
| @@ -1751,9 +1715,9 @@ buffer." | |||
| 1751 | 1715 | ||
| 1752 | ;Abbreviate for arrays and structures. These can be expanded using gud-display | 1716 | ;Abbreviate for arrays and structures. These can be expanded using gud-display |
| 1753 | (defun gdb-info-locals-handler nil | 1717 | (defun gdb-info-locals-handler nil |
| 1754 | (set-gdb-instance-pending-triggers (delq (quote gdb-invalidate-locals) | 1718 | (set-gdb-instance-pending-triggers (delq 'gdb-invalidate-locals |
| 1755 | (gdb-instance-pending-triggers))) | 1719 | (gdb-instance-pending-triggers))) |
| 1756 | (let ((buf (gdb-get-instance-buffer (quote gdb-partial-output-buffer)))) | 1720 | (let ((buf (gdb-get-instance-buffer 'gdb-partial-output-buffer))) |
| 1757 | (save-excursion | 1721 | (save-excursion |
| 1758 | (set-buffer buf) | 1722 | (set-buffer buf) |
| 1759 | (goto-char (point-min)) | 1723 | (goto-char (point-min)) |
| @@ -1762,16 +1726,16 @@ buffer." | |||
| 1762 | (replace-regexp "{[-0-9, {}\]*\n" "(array);\n"))) | 1726 | (replace-regexp "{[-0-9, {}\]*\n" "(array);\n"))) |
| 1763 | (goto-char (point-min)) | 1727 | (goto-char (point-min)) |
| 1764 | (replace-regexp "{.*=.*\n" "(structure);\n") | 1728 | (replace-regexp "{.*=.*\n" "(structure);\n") |
| 1765 | (let ((buf (gdb-get-instance-buffer (quote gdb-locals-buffer)))) | 1729 | (let ((buf (gdb-get-instance-buffer 'gdb-locals-buffer))) |
| 1766 | (and buf (save-excursion | 1730 | (and buf (save-excursion |
| 1767 | (set-buffer buf) | 1731 | (set-buffer buf) |
| 1768 | (let ((p (point)) | 1732 | (let ((p (point)) |
| 1769 | (buffer-read-only nil)) | 1733 | (buffer-read-only nil)) |
| 1770 | (delete-region (point-min) (point-max)) | 1734 | (delete-region (point-min) (point-max)) |
| 1771 | (insert-buffer (gdb-get-create-instance-buffer | 1735 | (insert-buffer (gdb-get-create-instance-buffer |
| 1772 | (quote gdb-partial-output-buffer))) | 1736 | 'gdb-partial-output-buffer)) |
| 1773 | (goto-char p))))) | 1737 | (goto-char p))))) |
| 1774 | (run-hooks (quote gdb-info-locals-hook))) | 1738 | (run-hooks 'gdb-info-locals-hook)) |
| 1775 | 1739 | ||
| 1776 | (defun gdb-info-locals-custom () | 1740 | (defun gdb-info-locals-custom () |
| 1777 | nil) | 1741 | nil) |
| @@ -1884,10 +1848,9 @@ buffer." | |||
| 1884 | (if (eq ?y (char-after (match-beginning 2))) | 1848 | (if (eq ?y (char-after (match-beginning 2))) |
| 1885 | "server disable display " | 1849 | "server disable display " |
| 1886 | "server enable display ") | 1850 | "server enable display ") |
| 1887 | (buffer-substring (match-beginning 0) | 1851 | (match-string 1) |
| 1888 | (match-end 1)) | ||
| 1889 | "\n") | 1852 | "\n") |
| 1890 | '(lambda () nil)))))) | 1853 | 'ignore))))) |
| 1891 | 1854 | ||
| 1892 | (defun gdb-delete-disp-this-line () | 1855 | (defun gdb-delete-disp-this-line () |
| 1893 | "Delete the displayed expression on this line." | 1856 | "Delete the displayed expression on this line." |
| @@ -1898,11 +1861,10 @@ buffer." | |||
| 1898 | (beginning-of-line 1) | 1861 | (beginning-of-line 1) |
| 1899 | (if (not (looking-at "\\([0-9]+\\): \\([ny]\\)")) | 1862 | (if (not (looking-at "\\([0-9]+\\): \\([ny]\\)")) |
| 1900 | (error "No expression on this line") | 1863 | (error "No expression on this line") |
| 1901 | (let ((number (buffer-substring (match-beginning 0) | 1864 | (let ((number (match-string 1))) |
| 1902 | (match-end 1)))) | ||
| 1903 | (gdb-instance-enqueue-idle-input | 1865 | (gdb-instance-enqueue-idle-input |
| 1904 | (list (concat "server delete display " number "\n") | 1866 | (list (concat "server delete display " number "\n") |
| 1905 | '(lambda () nil))) | 1867 | 'ignore)) |
| 1906 | (if (not (display-graphic-p)) | 1868 | (if (not (display-graphic-p)) |
| 1907 | (kill-buffer (get-buffer (concat "*display " number "*"))) | 1869 | (kill-buffer (get-buffer (concat "*display " number "*"))) |
| 1908 | ;else | 1870 | ;else |
| @@ -2179,23 +2141,22 @@ Just the partial-output buffer is left." | |||
| 2179 | (delete-other-windows)) | 2141 | (delete-other-windows)) |
| 2180 | 2142 | ||
| 2181 | (defun gdb-source-info () | 2143 | (defun gdb-source-info () |
| 2182 | "Finds the source file where the program starts and displays it with related | 2144 | "Find the source file where the program starts and displays it with related |
| 2183 | buffers." | 2145 | buffers." |
| 2184 | (goto-char (point-min)) | 2146 | (goto-char (point-min)) |
| 2185 | (re-search-forward "directory is ") | 2147 | (search-forward "directory is ") |
| 2186 | (looking-at "\\(\\S-*\\)") | 2148 | (looking-at "\\S-*") |
| 2187 | (setq gdb-cdir (buffer-substring (match-beginning 1) (match-end 1))) | 2149 | (setq gdb-cdir (match-string 0)) |
| 2188 | (re-search-forward "Located in ") | 2150 | (search-forward "Located in ") |
| 2189 | (looking-at "\\(\\S-*\\)") | 2151 | (looking-at "\\S-*") |
| 2190 | (setq gdb-main-file (buffer-substring (match-beginning 1) (match-end 1))) | 2152 | (setq gdb-main-file (match-string 0)) |
| 2191 | ;; Make sure we are not in the minibuffer window when we try to delete | 2153 | ;; Make sure we are not in the minibuffer window when we try to delete |
| 2192 | ;; all other windows. | 2154 | ;; all other windows. |
| 2193 | (if (eq (selected-window) (minibuffer-window)) | 2155 | (if (window-minibuffer-p (selected-window)) |
| 2194 | (other-window 1)) | 2156 | (other-window 1)) |
| 2195 | (delete-other-windows) | 2157 | (delete-other-windows) |
| 2196 | (if gdb-many-windows | 2158 | (if gdb-many-windows |
| 2197 | (gdb-setup-windows) | 2159 | (gdb-setup-windows) |
| 2198 | ;else | ||
| 2199 | (gdb-display-breakpoints-buffer) | 2160 | (gdb-display-breakpoints-buffer) |
| 2200 | (gdb-display-display-buffer) | 2161 | (gdb-display-display-buffer) |
| 2201 | (gdb-display-stack-buffer) | 2162 | (gdb-display-stack-buffer) |
| @@ -2307,7 +2268,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2307 | (interactive) | 2268 | (interactive) |
| 2308 | (gdb-instance-enqueue-idle-input | 2269 | (gdb-instance-enqueue-idle-input |
| 2309 | (list (concat "server delete display " gdb-display-number "\n") | 2270 | (list (concat "server delete display " gdb-display-number "\n") |
| 2310 | '(lambda () nil))) | 2271 | 'ignore)) |
| 2311 | (kill-buffer nil) | 2272 | (kill-buffer nil) |
| 2312 | (delete-frame)) | 2273 | (delete-frame)) |
| 2313 | 2274 | ||
| @@ -2350,8 +2311,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2350 | (looking-at | 2311 | (looking-at |
| 2351 | "\\([0-9]*\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*0x0\\(\\S-*\\)") | 2312 | "\\([0-9]*\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*0x0\\(\\S-*\\)") |
| 2352 | ; info break gives '0x0' (8 digit) while dump gives '0x' (7 digit) | 2313 | ; info break gives '0x0' (8 digit) while dump gives '0x' (7 digit) |
| 2353 | (setq address (concat "0x" (buffer-substring (match-beginning 3) | 2314 | (setq address (concat "0x" (match-string 3))) |
| 2354 | (match-end 3)))) | ||
| 2355 | (setq flag (char-after (match-beginning 2))) | 2315 | (setq flag (char-after (match-beginning 2))) |
| 2356 | (save-excursion | 2316 | (save-excursion |
| 2357 | (set-buffer buffer) | 2317 | (set-buffer buffer) |
| @@ -2427,30 +2387,29 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2427 | ; modified because if gdb-main-or-pc has changed value a new command | 2387 | ; modified because if gdb-main-or-pc has changed value a new command |
| 2428 | ; must be enqueued to update the buffer with the new output | 2388 | ; must be enqueued to update the buffer with the new output |
| 2429 | (defun gdb-invalidate-assembler (&optional ignored) | 2389 | (defun gdb-invalidate-assembler (&optional ignored) |
| 2430 | (if (and ((lambda () | 2390 | (if (and (gdb-get-instance-buffer 'gdb-assembler-buffer) |
| 2431 | (gdb-get-instance-buffer (quote gdb-assembler-buffer)))) | 2391 | (or (not (member 'gdb-invalidate-assembler |
| 2432 | (or (not (member (quote gdb-invalidate-assembler) | 2392 | (gdb-instance-pending-triggers))) |
| 2433 | (gdb-instance-pending-triggers))) | 2393 | (not (string-equal gdb-main-or-pc gdb-prev-main-or-pc)))) |
| 2434 | (not (string-equal gdb-main-or-pc gdb-prev-main-or-pc)))) | ||
| 2435 | (progn | 2394 | (progn |
| 2436 | 2395 | ||
| 2437 | ; take previous disassemble command off the queue | 2396 | ;; take previous disassemble command off the queue |
| 2438 | (save-excursion | 2397 | (save-excursion |
| 2439 | (set-buffer (gdb-get-instance-buffer 'gdba)) | 2398 | (set-buffer (gdb-get-instance-buffer 'gdba)) |
| 2440 | (let ((queue gdb-idle-input-queue) (item)) | 2399 | (let ((queue gdb-idle-input-queue) (item)) |
| 2441 | (while queue | 2400 | (while queue |
| 2442 | (setq item (car queue)) | 2401 | (setq item (car queue)) |
| 2443 | (if (equal (cdr item) '(gdb-assembler-handler)) | 2402 | (if (equal (cdr item) '(gdb-assembler-handler)) |
| 2444 | (delete item gdb-idle-input-queue)) | 2403 | (delete item gdb-idle-input-queue)) |
| 2445 | (setq queue (cdr queue))))) | 2404 | (setq queue (cdr queue))))) |
| 2446 | 2405 | ||
| 2447 | (gdb-instance-enqueue-idle-input | 2406 | (gdb-instance-enqueue-idle-input |
| 2448 | (list (concat "server disassemble " gdb-main-or-pc "\n") | 2407 | (list (concat "server disassemble " gdb-main-or-pc "\n") |
| 2449 | (quote gdb-assembler-handler))) | 2408 | 'gdb-assembler-handler)) |
| 2450 | (set-gdb-instance-pending-triggers | 2409 | (set-gdb-instance-pending-triggers |
| 2451 | (cons (quote gdb-invalidate-assembler) | 2410 | (cons 'gdb-invalidate-assembler |
| 2452 | (gdb-instance-pending-triggers))) | 2411 | (gdb-instance-pending-triggers))) |
| 2453 | (setq gdb-prev-main-or-pc gdb-main-or-pc)))) | 2412 | (setq gdb-prev-main-or-pc gdb-main-or-pc)))) |
| 2454 | 2413 | ||
| 2455 | (defun gdb-delete-line () | 2414 | (defun gdb-delete-line () |
| 2456 | "Delete the current line." | 2415 | "Delete the current line." |