我在.gdbinit中的用户定义的fn setup
中定义了一组基本断点。所以,每次我启动gdb,我都必须执行那个fn。在开始调试之前设置我的所有brkpoints。我可以配置我的.gdbinit,以便在它启动时首先执行我的用户定义的fn setup
吗?
答案 0 :(得分:9)
只需按功能名称调用:
我的.gdbinit:
define setup
echo Foobar\n
end
setup #This is the function call
当我运行它时:
$ gdb
GNU gdb Fedora (6.8-37.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Foobar
(gdb)