本文介绍了从shell脚本运行gdb命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想知道是否可以通过shell脚本将命令传递给GDB。
我将在代码中演示它,因此它更易于理解。
#!/ bin / sh
gdb --silent Application.app
b - [Class method]
脚本的执行停止在第2行,并且只有当我退出GDB时才继续。
如果甚至可以传递命令,我将如何传递该命令? :)
解决方案
gdb
文件的选项 - command = FILE
。您可以在 FILE
中写入所有gdb命令。
I was just wondering if it is possible to pass command to GDB from shell script.I will just demonstrate it in code, so it is easier to understand.
#!/bin/sh
gdb --silent Application.app
b -[Class method]
This causes the execution of the script to stop at line 2, and continue only when I quit GDB.
How would I pass the command, if it is even possible? :)
解决方案
gdb
has an option to run the commands from a file with option --command=FILE
. You can write all the gdb commands inside that FILE
.
这篇关于从shell脚本运行gdb命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-05 07:09