diff options
| author | Nick Roberts | 2008-04-19 06:41:23 +0000 |
|---|---|---|
| committer | Nick Roberts | 2008-04-19 06:41:23 +0000 |
| commit | 59ae30492b4fe8a7245061b580b7092ce22eb77f (patch) | |
| tree | b853dcfe7a7349a39362088bece7957c2cb7685d | |
| parent | 72fa7ca90d2cc9e9786d41b8701b77e7e9c785cb (diff) | |
| download | emacs-59ae30492b4fe8a7245061b580b7092ce22eb77f.tar.gz emacs-59ae30492b4fe8a7245061b580b7092ce22eb77f.zip | |
(gdb-thread-indicator): New variable.
(gdb-init-1): Initialise it.
(gdb-annotation-rules): New entry for "new-thread".
(gdb-thread-identification): New function to customize
mode-line-buffer-identification.
(gdb-frames-mode, gdb-registers-mode, gdb-locals-mode)
(gdb-assembler-mode): Use it.
(gdb-threads-mode): Force "info threads" onto queue.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index c175e079342..697a85cced1 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -123,6 +123,7 @@ where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame | |||
| 123 | address for root variables.") | 123 | address for root variables.") |
| 124 | (defvar gdb-main-file nil "Source file from which program execution begins.") | 124 | (defvar gdb-main-file nil "Source file from which program execution begins.") |
| 125 | (defvar gud-old-arrow nil) | 125 | (defvar gud-old-arrow nil) |
| 126 | (defvar gdb-thread-indicator nil) | ||
| 126 | (defvar gdb-overlay-arrow-position nil) | 127 | (defvar gdb-overlay-arrow-position nil) |
| 127 | (defvar gdb-stack-position nil) | 128 | (defvar gdb-stack-position nil) |
| 128 | (defvar gdb-server-prefix nil) | 129 | (defvar gdb-server-prefix nil) |
| @@ -627,7 +628,8 @@ otherwise do not." | |||
| 627 | gdb-look-up-stack nil | 628 | gdb-look-up-stack nil |
| 628 | gdb-frame-begin nil | 629 | gdb-frame-begin nil |
| 629 | gdb-printing t | 630 | gdb-printing t |
| 630 | gud-old-arrow nil) | 631 | gud-old-arrow nil |
| 632 | gdb-thread-indicator nil) | ||
| 631 | 633 | ||
| 632 | (setq gdb-buffer-type 'gdba) | 634 | (setq gdb-buffer-type 'gdba) |
| 633 | 635 | ||
| @@ -1318,13 +1320,14 @@ want the GDB Graphical Interface." | |||
| 1318 | ("stopped" gdb-stopped) | 1320 | ("stopped" gdb-stopped) |
| 1319 | ("error-begin" gdb-error) | 1321 | ("error-begin" gdb-error) |
| 1320 | ("error" gdb-error) | 1322 | ("error" gdb-error) |
| 1321 | ) "An assoc mapping annotation tags to functions which process them.") | 1323 | ("new-thread" (lambda (ignored) (gdb-get-buffer-create 'gdb-threads-buffer)))) |
| 1324 | "An assoc mapping annotation tags to functions which process them.") | ||
| 1322 | 1325 | ||
| 1323 | (defun gdb-resync() | 1326 | (defun gdb-resync() |
| 1324 | (setq gdb-flush-pending-output t) | 1327 | (setq gdb-flush-pending-output t) |
| 1325 | (setq gud-running nil) | 1328 | (setq gud-running nil) |
| 1326 | (gdb-force-mode-line-update | 1329 | (gdb-force-mode-line-update |
| 1327 | (propertize "stopped"'face font-lock-warning-face)) | 1330 | (propertize "stopped" 'face font-lock-warning-face)) |
| 1328 | (setq gdb-output-sink 'user) | 1331 | (setq gdb-output-sink 'user) |
| 1329 | (setq gdb-input-queue nil) | 1332 | (setq gdb-input-queue nil) |
| 1330 | (setq gdb-pending-triggers nil) | 1333 | (setq gdb-pending-triggers nil) |
| @@ -2333,6 +2336,7 @@ $pc directly from the GUD buffer. This command isn't normally needed." | |||
| 2333 | (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) | 2336 | (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) |
| 2334 | (setq truncate-lines t) ;; Make it easier to see overlay arrow. | 2337 | (setq truncate-lines t) ;; Make it easier to see overlay arrow. |
| 2335 | (setq buffer-read-only t) | 2338 | (setq buffer-read-only t) |
| 2339 | (gdb-thread-identification) | ||
| 2336 | (use-local-map gdb-frames-mode-map) | 2340 | (use-local-map gdb-frames-mode-map) |
| 2337 | (run-mode-hooks 'gdb-frames-mode-hook) | 2341 | (run-mode-hooks 'gdb-frames-mode-hook) |
| 2338 | (setq gdb-stack-update t) | 2342 | (setq gdb-stack-update t) |
| @@ -2379,6 +2383,12 @@ another GDB command e.g pwd, to see new frames") | |||
| 2379 | (let ((buffer-read-only nil)) | 2383 | (let ((buffer-read-only nil)) |
| 2380 | (save-excursion | 2384 | (save-excursion |
| 2381 | (goto-char (point-min)) | 2385 | (goto-char (point-min)) |
| 2386 | (if (re-search-forward "\\* \\([0-9]+\\)" nil t) | ||
| 2387 | (setq gdb-thread-indicator | ||
| 2388 | (propertize (concat " [" (match-string 1) "]") | ||
| 2389 | ; FIXME: this help-echo doesn't work | ||
| 2390 | 'help-echo "thread id"))) | ||
| 2391 | (goto-char (point-min)) | ||
| 2382 | (while (< (point) (point-max)) | 2392 | (while (< (point) (point-max)) |
| 2383 | (unless (looking-at "No ") | 2393 | (unless (looking-at "No ") |
| 2384 | (add-text-properties (line-beginning-position) (line-end-position) | 2394 | (add-text-properties (line-beginning-position) (line-end-position) |
| @@ -2430,7 +2440,8 @@ another GDB command e.g pwd, to see new frames") | |||
| 2430 | (set (make-local-variable 'font-lock-defaults) | 2440 | (set (make-local-variable 'font-lock-defaults) |
| 2431 | '(gdb-threads-font-lock-keywords)) | 2441 | '(gdb-threads-font-lock-keywords)) |
| 2432 | (run-mode-hooks 'gdb-threads-mode-hook) | 2442 | (run-mode-hooks 'gdb-threads-mode-hook) |
| 2433 | 'gdb-invalidate-threads) | 2443 | ;; Force "info threads" onto queue. |
| 2444 | (lambda () (let ((gud-running nil)) (gdb-invalidate-threads)))) | ||
| 2434 | 2445 | ||
| 2435 | (defun gdb-get-thread-number () | 2446 | (defun gdb-get-thread-number () |
| 2436 | (save-excursion | 2447 | (save-excursion |
| @@ -2445,8 +2456,12 @@ another GDB command e.g pwd, to see new frames") | |||
| 2445 | (list (concat gdb-server-prefix "thread " | 2456 | (list (concat gdb-server-prefix "thread " |
| 2446 | (gdb-get-thread-number) "\n") 'ignore)) | 2457 | (gdb-get-thread-number) "\n") 'ignore)) |
| 2447 | (gud-display-frame)) | 2458 | (gud-display-frame)) |
| 2448 | |||
| 2449 | 2459 | ||
| 2460 | (defun gdb-thread-identification () | ||
| 2461 | (setq mode-line-buffer-identification | ||
| 2462 | (list (car mode-line-buffer-identification) | ||
| 2463 | '(gdb-thread-indicator gdb-thread-indicator)))) | ||
| 2464 | |||
| 2450 | ;; Registers buffer. | 2465 | ;; Registers buffer. |
| 2451 | ;; | 2466 | ;; |
| 2452 | (defcustom gdb-all-registers nil | 2467 | (defcustom gdb-all-registers nil |
| @@ -2512,6 +2527,7 @@ another GDB command e.g pwd, to see new frames") | |||
| 2512 | (setq major-mode 'gdb-registers-mode) | 2527 | (setq major-mode 'gdb-registers-mode) |
| 2513 | (setq mode-name "Registers") | 2528 | (setq mode-name "Registers") |
| 2514 | (setq buffer-read-only t) | 2529 | (setq buffer-read-only t) |
| 2530 | (gdb-thread-identification) | ||
| 2515 | (use-local-map gdb-registers-mode-map) | 2531 | (use-local-map gdb-registers-mode-map) |
| 2516 | (run-mode-hooks 'gdb-registers-mode-hook) | 2532 | (run-mode-hooks 'gdb-registers-mode-hook) |
| 2517 | (if (string-equal gdb-version "pre-6.4") | 2533 | (if (string-equal gdb-version "pre-6.4") |
| @@ -2946,6 +2962,7 @@ corresponding to the mode line clicked." | |||
| 2946 | (setq major-mode 'gdb-locals-mode) | 2962 | (setq major-mode 'gdb-locals-mode) |
| 2947 | (setq mode-name (concat "Locals:" gdb-selected-frame)) | 2963 | (setq mode-name (concat "Locals:" gdb-selected-frame)) |
| 2948 | (setq buffer-read-only t) | 2964 | (setq buffer-read-only t) |
| 2965 | (gdb-thread-identification) | ||
| 2949 | (use-local-map gdb-locals-mode-map) | 2966 | (use-local-map gdb-locals-mode-map) |
| 2950 | (set (make-local-variable 'font-lock-defaults) | 2967 | (set (make-local-variable 'font-lock-defaults) |
| 2951 | '(gdb-locals-font-lock-keywords)) | 2968 | '(gdb-locals-font-lock-keywords)) |
| @@ -3173,7 +3190,7 @@ buffers." | |||
| 3173 | (goto-char (point-min)) | 3190 | (goto-char (point-min)) |
| 3174 | (if (search-forward "Includes preprocessor macro info." nil t) | 3191 | (if (search-forward "Includes preprocessor macro info." nil t) |
| 3175 | (setq gdb-macro-info t)) | 3192 | (setq gdb-macro-info t)) |
| 3176 | (if gdb-many-windows | 3193 | (if gdb-many-windows |
| 3177 | (gdb-setup-windows) | 3194 | (gdb-setup-windows) |
| 3178 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) | 3195 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
| 3179 | (if gdb-show-main | 3196 | (if gdb-show-main |
| @@ -3434,6 +3451,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 3434 | (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position) | 3451 | (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position) |
| 3435 | (setq fringes-outside-margins t) | 3452 | (setq fringes-outside-margins t) |
| 3436 | (setq buffer-read-only t) | 3453 | (setq buffer-read-only t) |
| 3454 | (gdb-thread-identification) | ||
| 3437 | (use-local-map gdb-assembler-mode-map) | 3455 | (use-local-map gdb-assembler-mode-map) |
| 3438 | (gdb-invalidate-assembler) | 3456 | (gdb-invalidate-assembler) |
| 3439 | (set (make-local-variable 'font-lock-defaults) | 3457 | (set (make-local-variable 'font-lock-defaults) |