2

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 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.