Mercurial > emacs
comparison lisp/progmodes/gdb-ui.el @ 83531:a387c138b28e
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-305
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-306
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-307
Update from CVS: lispref/display.texi (Forcing Redisplay): Fix typo.
* emacs@sv.gnu.org/emacs--devo--0--patch-308
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-309
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-310
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-311
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-312
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-313
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-314
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-315
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-316
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-317
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-318
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-319
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-320
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-321
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-322
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-323
lisp/play/cookie1.el (cookie): Work properly when there's only one entry
* emacs@sv.gnu.org/emacs--devo--0--patch-324
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-325
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-326
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-327
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-328
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-329
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-330
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-105
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-106
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-107
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-108
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-109
Clean up merge mistakes
* emacs@sv.gnu.org/gnus--rel--5.10--patch-110
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-571
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Tue, 27 Jun 2006 15:06:36 +0000 |
parents | 46b1096093f5 f723aa5cf2de |
children | b19aaf4ab0ee |
comparison
equal
deleted
inserted
replaced
83530:46b1096093f5 | 83531:a387c138b28e |
---|---|
74 ;; contents change unless the first character changes. | 74 ;; contents change unless the first character changes. |
75 ;; 2) Cannot handle multiple debug sessions. | 75 ;; 2) Cannot handle multiple debug sessions. |
76 ;; 3) M-x gdb doesn't work with "run" command in .gdbinit, use M-x gdba instead. | 76 ;; 3) M-x gdb doesn't work with "run" command in .gdbinit, use M-x gdba instead. |
77 ;; 4) M-x gdb doesn't work if the corefile is specified in the command in the | 77 ;; 4) M-x gdb doesn't work if the corefile is specified in the command in the |
78 ;; minibuffer, use M-x gdba instead (or specify the core in the GUD buffer). | 78 ;; minibuffer, use M-x gdba instead (or specify the core in the GUD buffer). |
79 ;; 5) If you wish to call procedures from your program in GDB | |
80 ;; e.g "call myproc ()", "p mysquare (5)" then use level 2 annotations | |
81 ;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed. | |
79 | 82 |
80 ;;; Problems with watch expressions, GDB/MI: | 83 ;;; Problems with watch expressions, GDB/MI: |
81 ;; 1) They go out of scope when the inferior is re-run. | 84 ;; 1) They go out of scope when the inferior is re-run. |
82 ;; 2) -stack-list-locals has a type field but also prints type in values field. | 85 ;; 2) -stack-list-locals has a type field but also prints type in values field. |
83 ;; 3) VARNUM increments even when variable object is not created | 86 ;; 3) VARNUM increments even when variable object is not created |
108 "List of variables in watch window. | 111 "List of variables in watch window. |
109 Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP) | 112 Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP) |
110 where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame | 113 where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame |
111 address for root variables.") | 114 address for root variables.") |
112 (defvar gdb-main-file nil "Source file from which program execution begins.") | 115 (defvar gdb-main-file nil "Source file from which program execution begins.") |
116 (defvar gud-old-arrow nil) | |
113 (defvar gdb-overlay-arrow-position nil) | 117 (defvar gdb-overlay-arrow-position nil) |
114 (defvar gdb-server-prefix nil) | 118 (defvar gdb-server-prefix nil) |
115 (defvar gdb-flush-pending-output nil) | 119 (defvar gdb-flush-pending-output nil) |
116 (defvar gdb-location-alist nil | 120 (defvar gdb-location-alist nil |
117 "Alist of breakpoint numbers and full filenames.") | 121 "Alist of breakpoint numbers and full filenames.") |
124 (defvar gdb-signalled nil) | 128 (defvar gdb-signalled nil) |
125 (defvar gdb-source-window nil) | 129 (defvar gdb-source-window nil) |
126 (defvar gdb-inferior-status nil) | 130 (defvar gdb-inferior-status nil) |
127 (defvar gdb-continuation nil) | 131 (defvar gdb-continuation nil) |
128 (defvar gdb-look-up-stack nil) | 132 (defvar gdb-look-up-stack nil) |
133 (defvar gdb-frame-begin nil | |
134 "Non-nil when GDB generates frame-begin annotation.") | |
135 (defvar gdb-printing t) | |
129 | 136 |
130 (defvar gdb-buffer-type nil | 137 (defvar gdb-buffer-type nil |
131 "One of the symbols bound in `gdb-buffer-rules'.") | 138 "One of the symbols bound in `gdb-buffer-rules'.") |
132 (make-variable-buffer-local 'gdb-buffer-type) | 139 (make-variable-buffer-local 'gdb-buffer-type) |
133 | 140 |
541 gdb-debug-ring nil | 548 gdb-debug-ring nil |
542 gdb-signalled nil | 549 gdb-signalled nil |
543 gdb-source-window nil | 550 gdb-source-window nil |
544 gdb-inferior-status nil | 551 gdb-inferior-status nil |
545 gdb-continuation nil | 552 gdb-continuation nil |
546 gdb-look-up-stack nil) | 553 gdb-look-up-stack nil |
554 gdb-frame-begin nil | |
555 gdb-printing t | |
556 gud-old-arrow nil) | |
547 | 557 |
548 (setq gdb-buffer-type 'gdba) | 558 (setq gdb-buffer-type 'gdba) |
549 | 559 |
550 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io)) | 560 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io)) |
551 | 561 |
1268 (defun gdb-starting (ignored) | 1278 (defun gdb-starting (ignored) |
1269 "An annotation handler for `starting'. | 1279 "An annotation handler for `starting'. |
1270 This says that I/O for the subprocess is now the program being debugged, | 1280 This says that I/O for the subprocess is now the program being debugged, |
1271 not GDB." | 1281 not GDB." |
1272 (setq gdb-active-process t) | 1282 (setq gdb-active-process t) |
1283 (setq gdb-printing t) | |
1273 (let ((sink gdb-output-sink)) | 1284 (let ((sink gdb-output-sink)) |
1274 (cond | 1285 (cond |
1275 ((eq sink 'user) | 1286 ((eq sink 'user) |
1276 (progn | 1287 (progn |
1277 (setq gud-running t) | 1288 (setq gud-running t) |
1278 (setq gdb-inferior-status "running") | 1289 (setq gdb-inferior-status "running") |
1279 (gdb-force-mode-line-update gdb-inferior-status) | 1290 (gdb-force-mode-line-update gdb-inferior-status) |
1280 (gdb-remove-text-properties) | 1291 (gdb-remove-text-properties) |
1292 (setq gud-old-arrow gud-overlay-arrow-position) | |
1281 (setq gud-overlay-arrow-position nil) | 1293 (setq gud-overlay-arrow-position nil) |
1282 (setq gdb-overlay-arrow-position nil) | 1294 (setq gdb-overlay-arrow-position nil) |
1283 (if gdb-use-separate-io-buffer | 1295 (if gdb-use-separate-io-buffer |
1284 (setq gdb-output-sink 'inferior)))) | 1296 (setq gdb-output-sink 'inferior)))) |
1285 (t | 1297 (t |
1311 function is used to change the focus of GUD tooltips to #define | 1323 function is used to change the focus of GUD tooltips to #define |
1312 directives." | 1324 directives." |
1313 (setq gdb-active-process nil) | 1325 (setq gdb-active-process nil) |
1314 (setq gud-overlay-arrow-position nil) | 1326 (setq gud-overlay-arrow-position nil) |
1315 (setq gdb-overlay-arrow-position nil) | 1327 (setq gdb-overlay-arrow-position nil) |
1328 (setq gud-old-arrow nil) | |
1316 (setq gdb-inferior-status "exited") | 1329 (setq gdb-inferior-status "exited") |
1317 (gdb-force-mode-line-update gdb-inferior-status) | 1330 (gdb-force-mode-line-update gdb-inferior-status) |
1318 (gdb-stopping ignored)) | 1331 (gdb-stopping ignored)) |
1319 | 1332 |
1320 (defun gdb-signalled (ignored) | 1333 (defun gdb-signalled (ignored) |
1321 (setq gdb-signalled t)) | 1334 (setq gdb-signalled t)) |
1322 | 1335 |
1323 (defun gdb-frame-begin (ignored) | 1336 (defun gdb-frame-begin (ignored) |
1337 (setq gdb-frame-begin t) | |
1338 (setq gdb-printing nil) | |
1324 (let ((sink gdb-output-sink)) | 1339 (let ((sink gdb-output-sink)) |
1325 (cond | 1340 (cond |
1326 ((eq sink 'inferior) | 1341 ((eq sink 'inferior) |
1327 (setq gdb-output-sink 'user)) | 1342 (setq gdb-output-sink 'user)) |
1328 ((eq sink 'user) t) | 1343 ((eq sink 'user) t) |
1329 ((eq sink 'emacs) t) | 1344 ((eq sink 'emacs) t) |
1330 (t | 1345 (t |
1331 (gdb-resync) | 1346 (gdb-resync) |
1332 (error "Unexpected frame-begin annotation (%S)" sink))))) | 1347 (error "Unexpected frame-begin annotation (%S)" sink))))) |
1333 | 1348 |
1349 (defcustom gdb-same-frame focus-follows-mouse | |
1350 "Non-nil means pop up GUD buffer in same frame." | |
1351 :group 'gud | |
1352 :type 'boolean | |
1353 :version "22.1") | |
1354 | |
1334 (defun gdb-stopped (ignored) | 1355 (defun gdb-stopped (ignored) |
1335 "An annotation handler for `stopped'. | 1356 "An annotation handler for `stopped'. |
1336 It is just like `gdb-stopping', except that if we already set the output | 1357 It is just like `gdb-stopping', except that if we already set the output |
1337 sink to `user' in `gdb-stopping', that is fine." | 1358 sink to `user' in `gdb-stopping', that is fine." |
1338 (setq gud-running nil) | 1359 (setq gud-running nil) |
1339 (unless (or gud-overlay-arrow-position gud-last-frame) | 1360 (unless (or gud-overlay-arrow-position gud-last-frame) |
1361 (if (and gdb-frame-begin gdb-printing) | |
1362 (setq gud-overlay-arrow-position gud-old-arrow) | |
1340 ;;Pop up GUD buffer to display current frame when it doesn't have source | 1363 ;;Pop up GUD buffer to display current frame when it doesn't have source |
1341 ;;information i.e id not compiled with -g as with libc routines generally. | 1364 ;;information i.e id not compiled with -g as with libc routines generally. |
1342 (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1365 (if gdb-same-frame |
1343 (special-display-frame-alist gdb-frame-parameters) | 1366 (gdb-display-gdb-buffer) |
1344 (same-window-regexps nil)) | 1367 (gdb-frame-gdb-buffer)) |
1345 (display-buffer gud-comint-buffer)) | |
1346 ;;Try to find source further up stack e.g after signal. | 1368 ;;Try to find source further up stack e.g after signal. |
1347 (setq gdb-look-up-stack | 1369 (setq gdb-look-up-stack |
1348 (if (gdb-get-buffer 'gdb-stack-buffer) 'keep | 1370 (if (gdb-get-buffer 'gdb-stack-buffer) |
1371 'keep | |
1349 (progn | 1372 (progn |
1350 (gdb-get-buffer-create 'gdb-stack-buffer) | 1373 (gdb-get-buffer-create 'gdb-stack-buffer) |
1351 (gdb-invalidate-frames) | 1374 (gdb-invalidate-frames) |
1352 'delete)))) | 1375 'delete))))) |
1353 (unless (member gdb-inferior-status '("exited" "signal")) | 1376 (unless (member gdb-inferior-status '("exited" "signal")) |
1354 (setq gdb-inferior-status "stopped") | 1377 (setq gdb-inferior-status "stopped") |
1355 (gdb-force-mode-line-update gdb-inferior-status)) | 1378 (gdb-force-mode-line-update gdb-inferior-status)) |
1356 (let ((sink gdb-output-sink)) | 1379 (let ((sink gdb-output-sink)) |
1357 (cond | 1380 (cond |
2755 | 2778 |
2756 (defun gdb-frame-gdb-buffer () | 2779 (defun gdb-frame-gdb-buffer () |
2757 "Display GUD buffer in a new frame." | 2780 "Display GUD buffer in a new frame." |
2758 (interactive) | 2781 (interactive) |
2759 (let ((special-display-regexps (append special-display-regexps '(".*"))) | 2782 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
2760 (special-display-frame-alist gdb-frame-parameters) | 2783 (special-display-frame-alist |
2784 (remove '(menu-bar-lines) (remove '(tool-bar-lines) | |
2785 gdb-frame-parameters))) | |
2761 (same-window-regexps nil)) | 2786 (same-window-regexps nil)) |
2762 (display-buffer gud-comint-buffer))) | 2787 (display-buffer gud-comint-buffer))) |
2763 | 2788 |
2764 (defun gdb-display-gdb-buffer () | 2789 (defun gdb-display-gdb-buffer () |
2765 "Display GUD buffer." | 2790 "Display GUD buffer." |
3191 (when (re-search-forward | 3216 (when (re-search-forward |
3192 "Stack level \\([0-9]+\\), frame at \\(0x[[:xdigit:]]+\\)" nil t) | 3217 "Stack level \\([0-9]+\\), frame at \\(0x[[:xdigit:]]+\\)" nil t) |
3193 (setq gdb-frame-number (match-string 1)) | 3218 (setq gdb-frame-number (match-string 1)) |
3194 (setq gdb-frame-address (match-string 2))) | 3219 (setq gdb-frame-address (match-string 2))) |
3195 (goto-char (point-min)) | 3220 (goto-char (point-min)) |
3196 (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-+?\\)\ | 3221 (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(.*?\\)\ |
3197 \\(?: (\\(\\S-+?\\):[0-9]+?)\\)*;? " | 3222 \\(?: (\\(\\S-+?\\):[0-9]+?)\\)*; " |
3198 nil t) | 3223 nil t) |
3199 (setq gdb-selected-frame (match-string 2)) | 3224 (setq gdb-selected-frame (match-string 2)) |
3200 (if (gdb-get-buffer 'gdb-locals-buffer) | 3225 (if (gdb-get-buffer 'gdb-locals-buffer) |
3201 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) | 3226 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) |
3202 (setq mode-name (concat "Locals:" gdb-selected-frame)))) | 3227 (setq mode-name (concat "Locals:" gdb-selected-frame)))) |