【发布时间】:2021-12-17 02:21:15
【问题描述】:
这是汇编代码的一部分(u-boot、arch/arm/include/debug/8250.S)
.macro addruart, rp, rv, tmp
ldr \rp, =CONFIG_DEBUG_UART_PHYS
ldr \rv, =CONFIG_DEBUG_UART_VIRT
.endm
我想为这种类型的宏定义提取标签。所以我提到了How to write .ctags file for assembly extention?
但不知何故,我的试验不起作用。
我尝试了以下所有这些命令,但都未能显示标签 (addruart)。
假设这个 8250.S 文件在 /tmp 下并且只包含那 4 行。实际上每行都有两个缩进标签。在.macro 和adduart 之间也是一个标签。
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro[\t ]+\(([a-zA-Z_0-9]+)\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro[\t ][\t ]*\([a-zA-Z_0-9]+\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro[\t ][\t ]*\([a-zA-Z_0-9][a-zA-Z_0-9]*\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro[\t ]\([a-zA-Z_0-9][a-zA-Z_0-9]*\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro\t\([a-zA-Z_0-9][a-zA-Z_0-9]*\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro\([a-zA-Z_0-9][a-zA-Z_0-9]*\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$ ctags --regex-Asm='/\.macro\([a-zA-Z_0-9][a-zA-Z_0-9]*\)/\1/m,macro/' -o - /tmp/8250.S
ckim@ckim-ubuntu:~/U-BOOT/u-boot$
我该怎么做?
我的 ctags 版本:
Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex
【问题讨论】:
标签: ctags exuberant-ctags