Run gdb command from shell script

谁说胖子不能爱 提交于 2019-12-12 02:36:49

问题


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? :)


回答1:


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.



来源:https://stackoverflow.com/questions/17863025/run-gdb-command-from-shell-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!