[binutils-gdb] Fix "compilation unit" matching in dwarf-font-lock-keywords

Tom Tromey tromey@sourceware.org
Thu Feb 20 16:45:34 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3fddd4e758fa330fb9f60fce17831c2062d8d9ef

commit 3fddd4e758fa330fb9f60fce17831c2062d8d9ef
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Feb 20 09:38:05 2025 -0700

    Fix "compilation unit" matching in dwarf-font-lock-keywords
    
    Today I learned that, at least on my system (Fedora 40), the printf
    "%#x" format will produce "0" rather than "0x0" when given 0 as an
    argument.
    
    This causes dwarf-mode.el to not correctly fontify the very first
    "Compilation Unit" line it sees.
    
    This patch adapts dwarf-mode.el.  As always, this patch bumps the
    version number for easier installation.
    
    I am checking this in.

Diff:
---
 binutils/dwarf-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/binutils/dwarf-mode.el b/binutils/dwarf-mode.el
index fd6c7c47b17..3de7d42eabd 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.8
+;; Version: 1.9
 
 ;; Copyright (C) 2012-2025 Free Software Foundation, Inc.
 
@@ -30,7 +30,7 @@
     ("DW_AT_[a-zA-Z_]*name\\s *:\\(?:\\s *(.*):\\)?\\s *\\(.*\\)\\s *$"
      (1 font-lock-function-name-face))
 
-    ("Compilation Unit @ offset 0x[0-9a-f]+"
+    ("Compilation Unit @ offset \\(0x[0-9a-f]+\\|0\\)"
      (0 font-lock-string-face))
     ))


More information about the Binutils-cvs mailing list