;;; dwarf-mode.el --- Browser for DWARF information. -*-lexical-binding:t-*-
-;; Version: 1.4
+;; Version: 1.6
-;; Copyright (C) 2012-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
;; This file is not part of GNU Emacs, but is distributed under the
;; same terms:
(defconst dwarf-font-lock-keywords
'(
;; Name and linkage name.
- ("DW_AT_[a-z_]*name\\s *: .*:\\(.*\\)\\s *$"
+ ("DW_AT_[a-zA-Z_]*name\\s *:\\(?:\\s *(.*):\\)?\\s *\\(.*\\)\\s *$"
(1 font-lock-function-name-face))
("Compilation Unit @ offset 0x[0-9a-f]+"
;; Either follows a DIE reference, or expands a "...".
(defun dwarf-die-button-action (button)
(let* ((die (button-get button 'die))
- ;; Note that the first number can only be decimal.
- (die-rx (concat "^\\s *\\(<[0-9]+>\\)?<"
- die ">[^<]"))
+ ;; Note that the first number can only be decimal. It is
+ ;; included in this search because otherwise following a ref
+ ;; might lead to a zero-length boolean attribute in the
+ ;; previous DIE.
+ (die-rx (concat "^\\s *<[0-9]+><" die ">:"))
(old (point))
(is-ref (button-get button 'die-ref)))
(if is-ref
(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
+ ;; <...> does not also copy the ">".
+ (modify-syntax-entry ?< "(>" table)
+ (modify-syntax-entry ?> ")<" table)
+ table)
+ "Syntax table for dwarf-mode buffers.")
+
(defvar dwarf-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map special-mode-map)