我在 .gdbinit 中的用户定义 fn setup
中定义了一组基本断点。所以,每次启动 gdb 时,我都必须执行该 fn。在开始调试之前设置我的所有 brkpoints 。我可以配置我的 .gdbinit 以便每当它启动时,它首先执行我的用户定义的 fn setup
吗?
最佳答案
只需通过函数名称调用即可:
我的.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)
关于debugging - 如何让gdb每次启动时都运行用户定义的函数(在.gdbinit中定义)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1913135/