0

I want to write a script that will read a process memory, and display its contents with some modification/format. It would be create if i could run a c program inside gdb and send gdb commands from this program. Do you know if it is possible ?

1
  • Yes it is possibe, many ide do this. Need to open process with handling process input/output/error streams. Read and analize outputs stream and put your command to input stream. Commented Jun 29, 2016 at 20:59

1 Answer 1

1

It would be great if i could run a c program inside gdb and send gdb commands from this program.

That's easy:

(gdb) shell /tmp/a.out > /tmp/gdb.script
(gdb) source /tmp/gdb.script

If your gdb is built with Python support, much better scripting support is available. Start here.

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

1 Comment

In fact i want more interaction. In your case, the a.out c program generates commands and then run once. But i will look if it is better with your Python link

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.