gpt4 book ai didi

c - Linux,如何在 GDB 中运行 c 代码之前等待几秒钟

转载 作者:太空狗 更新时间:2023-10-29 11:13:04 25 4
gpt4 key购买 nike

我正在使用以下命令加载 c 文件程序并在 GDB 中从终端一键运行它:

gdb --eval-command='file c.out' --eval-command='c'

我想在加载程序后但在 GDB 中启动程序之前睡几秒钟,比如:

gdb --eval-command='file c.out' --eval-command='<sleep 5>' --eval-command='c'

最佳答案

给 gdb 一个命令行选项使其暂停 5 秒的一种方法是告诉它在 shell 中运行“sleep 5”命令:

--eval-command="shell sleep 5"

关于c - Linux,如何在 GDB 中运行 c 代码之前等待几秒钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33679456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com