X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=binutils%2Fdwarf-mode.el;h=3ab2e1884782a7bc25655576cb872013399c4707;hb=f717822dd7b07c8b1cb92a19bc4778bd9c967116;hp=9df875ca4fe8526e680698339d55e208afea1ed6;hpb=cda8dc94dfff823bf0284e5140c6065f143a9f51;p=binutils-gdb.git diff --git a/binutils/dwarf-mode.el b/binutils/dwarf-mode.el index 9df875ca4fe..3ab2e188478 100644 --- a/binutils/dwarf-mode.el +++ b/binutils/dwarf-mode.el @@ -1,8 +1,8 @@ ;;; dwarf-mode.el --- Browser for DWARF information. -*-lexical-binding:t-*- -;; Version: 1.7 +;; Version: 1.8 -;; Copyright (C) 2012-2022 Free Software Foundation, Inc. +;; Copyright (C) 2012-2023 Free Software Foundation, Inc. ;; This file is not part of GNU Emacs, but is distributed under the ;; same terms: @@ -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 @@ -177,7 +177,7 @@ A prefix argument means expand all children." ;; Run objdump and insert the contents into the buffer. The arguments ;; are the way they are because this is also called as a ;; revert-buffer-function. -(defun dwarf-do-refresh (&rest ignore) +(defun dwarf-do-refresh (&rest _ignore) (dwarf--check-running) (let ((inhibit-read-only t)) (dwarf--invoke (point-min) (point-max) @@ -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))