diff options
author | Tom Tromey <tromey@adacore.com> | 2023-02-09 13:33:21 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-02-09 13:50:21 -0700 |
commit | 93c8054387a7f0ba7ca1f1dcc671a1b5c0c0db07 (patch) | |
tree | 150e4307b0bfd9ba2537d6e564a9e1ea900b895e /binutils | |
parent | 8e77fff268d4aab7951f4d19af9e2f9046c9c0a0 (diff) | |
download | gdb-93c8054387a7f0ba7ca1f1dcc671a1b5c0c0db07.zip gdb-93c8054387a7f0ba7ca1f1dcc671a1b5c0c0db07.tar.gz gdb-93c8054387a7f0ba7ca1f1dcc671a1b5c0c0db07.tar.bz2 |
Add full display feature to dwarf-mode.el
I've found that I often use dwarf-mode with relatively small test
files. In this situation, it's handy to be able to expand all the
DWARF, rather than moving to each "..." separately and using C-u C-m.
This patch implements this feature. It also makes a couple of other
minor changes:
* I removed a stale FIXME from dwarf-mode. In practice I find I often
use "g" to restore the buffer to a pristine state; checking the file
mtime would work against this.
* I tightened the regexp in dwarf-insert-substructure. This prevents
the C-m binding from trying to re-read a DIE which has already been
expanded.
* Finally, I've bumped the dwarf-mode version number so that this
version can easily be installed using package.el.
2023-02-09 Tom Tromey <tromey@adacore.com>
* dwarf-mode.el: Bump version to 1.8.
(dwarf-insert-substructure): Tighten regexp.
(dwarf-refresh-all): New defun.
(dwarf-mode-map): Bind "A" to dwarf-refresh-all.
(dwarf-mode): Remove old FIXME.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 8 | ||||
-rw-r--r-- | binutils/dwarf-mode.el | 17 |
2 files changed, 22 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9753a32..94099d7 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,11 @@ +2023-02-09 Tom Tromey <tromey@adacore.com> + + * dwarf-mode.el: Bump version to 1.8. + (dwarf-insert-substructure): Tighten regexp. + (dwarf-refresh-all): New defun. + (dwarf-mode-map): Bind "A" to dwarf-refresh-all. + (dwarf-mode): Remove old FIXME. + 2023-02-07 Nick Clifton <nickc@redhat.com> PR 30080 diff --git a/binutils/dwarf-mode.el b/binutils/dwarf-mode.el index 82f6753..3ab2e18 100644 --- a/binutils/dwarf-mode.el +++ b/binutils/dwarf-mode.el @@ -1,6 +1,6 @@ ;;; dwarf-mode.el --- Browser for DWARF information. -*-lexical-binding:t-*- -;; Version: 1.7 +;; Version: 1.8 ;; Copyright (C) 2012-2023 Free Software Foundation, Inc. @@ -111,7 +111,7 @@ By default, expands just one level of children. A prefix argument means expand all children." (interactive "P") (beginning-of-line) - (unless (looking-at "^ <\\([0-9]+\\)><\\([0-9a-f]+\\)>") + (unless (looking-at "^ <\\([0-9]+\\)><\\([0-9a-f]+\\)>: \\.\\.\\.") (error "Unrecognized line.")) (let ((die (match-string 2))) (if arg @@ -185,6 +185,17 @@ A prefix argument means expand all children." (expand-file-name dwarf-file)) (set-buffer-modified-p nil))) +(defun dwarf-refresh-all () + "Refresh the current buffer without eliding substructure. +Note that this can result in very voluminous output." + (interactive) + (dwarf--check-running) + (let ((inhibit-read-only t)) + (dwarf--invoke (point-min) (point-max) + dwarf-objdump-program "-Wi" + (expand-file-name dwarf-file)) + (set-buffer-modified-p nil))) + (defvar dwarf-mode-syntax-table (let ((table (make-syntax-table))) ;; This at least makes it so mark-sexp on some hex digits inside @@ -198,6 +209,7 @@ A prefix argument means expand all children." (let ((map (make-sparse-keymap))) (set-keymap-parent map special-mode-map) (define-key map [(control ?m)] #'dwarf-insert-substructure) + (define-key map "A" #'dwarf-refresh-all) map) "Keymap for dwarf-mode buffers.") @@ -207,7 +219,6 @@ A prefix argument means expand all children." \\{dwarf-mode-map}" (set (make-local-variable 'font-lock-defaults) '(dwarf-font-lock-keywords)) - ;; FIXME: we could be smarter and check the file time. (set (make-local-variable 'revert-buffer-function) #'dwarf-do-refresh) (jit-lock-register #'dwarf-fontify-region)) |