假设我定义了一个 new gdb command其中包括别名。
import gdb
import string
class PrettyPrintString (gdb.Command):
"Command to print strings with a mix of ascii and hex."
def __init__(self):
super (PrettyPrintString, self).__init__("ascii-print",
gdb.COMMAND_DATA,
gdb.COMPLETE_EXPRESSION, True)
gdb.execute("alias -a pp = ascii-print", True)
现在,我想对脚本做一个小改动,并在同一个 gdb session 中再次获取它。不幸的是,当我再次尝试获取源时,出现以下错误。
gdb.error: Alias already exists: pp
如何删除原始别名并获取更新的脚本?
请注意 alias documentation似乎没有说明删除别名,我试过
unalias
和 delete
但两者都没有达到预期的效果。
最佳答案
您可以为函数定义关键字而不是别名。例如我有
define w
where
end
在我的 .gdbinit 中。并重新定义作品,而不是重新锯齿。
关于gdb - 是否可以在不重新启动 gdb 的情况下删除 gdb 别名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49744411/