[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font-lock in machine mode of gdba

From: Masatake YAMATO
Subject: Re: font-lock in machine mode of gdba
Date: Sun, 24 Oct 2004 08:49:13 +0900 (JST)


>  > I'm using disassembly for hacking and understanding glibc's
>  > /lib/ld-linux.so.2 on i386.  (gdba is extremely useful.)  I feel my
>  > definition is not so bad. The face usage is consistent with asm-mode.
> OK. I've installed these changes, trying to bear in mind Stefan's comments.
> Note, however, that your fontification (gdb-assembler-font-lock-keywords)
> doesn't seem to work for system library functions e.g:
> 0x40062155 <__libc_start_main+133>:   push   %edi
> On my system (Mandrake 9.2) you can get this by breaking any C prgram in
> main and going up a level (you might have to click on the GUD buffer to get
> fontification).
> Nick

I could reproduce the bug.

In my last kewords definition, underscores in a function name was not handled.
Now underscores and periods are handled.

I've changed my mind: the addresses have no fontification becuase finally I 
too decorative.

The address fontification will be worth if other gud-ui buffers
introduce font-lock; the awareness of address string in the buffers
will be improved by using the same face on the all gud-ui buffers.
However, I have not used other buffers of gud-ui well yet, I should
not touch more. Switch view between source and machine code by
keyboard is much more important:)

Masatake YAMATO

Index: lisp/progmodes/gdb-ui.el
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gdb-ui.el,v
retrieving revision 1.25
diff -u -r1.25 gdb-ui.el
--- lisp/progmodes/gdb-ui.el    23 Oct 2004 22:00:48 -0000      1.25
+++ lisp/progmodes/gdb-ui.el    23 Oct 2004 23:34:03 -0000
@@ -1950,13 +1981,15 @@
 (defvar gdb-assembler-font-lock-keywords
-  '(("[^\$]0x[0-9a-f]+" . font-lock-constant-face)
-    ("^\\(0x*[0-9a-f]+\\) ?\\(<\\(\\sw+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
-     (1 font-lock-constant-face) 
-     (3 font-lock-function-name-face) 
+  '(;; <__function.name+n>
+    ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
+     (1 font-lock-function-name-face))
+    ;; 0xNNNNNNNN <__function.name+n>: opcode
+    ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ 
      (4 font-lock-keyword-face))
+    ;; %register(at least i386)
     ("%\\sw+" . font-lock-variable-name-face)
-    ("^\\(Dump of assembler code for function\\) \\(.+\\):" 
+    ("^\\(Dump of assembler code for function\\) \\(.+\\):"
      (1 font-lock-comment-face)
      (2 font-lock-function-name-face))
     ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]