0

I want to pass some inputs to my gdb debugger to automate it.

Something like this:

Enter number of inputs:
5
Enter 5 inputs:
2 4 3 2 5

I have an expect script for that to automate my binary file.

Can I combine my expect script and gdb script?

2
  • how do you want to interact with the gdb? Commented Jun 2, 2021 at 4:06
  • @sexpect-ExpectforShells . I don't know. Is there a way to do this? Commented Jun 2, 2021 at 9:44

1 Answer 1

2

Create a file testinput.txt containing:

5
2 4 3 5 2

Then in gdb:

(gdb) run < testinput.txt
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks @Clifford. How a bout expect? Can I do something like this with that?
@MiladS Your question has no details about that, and is probably a separate question in any case.

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.