Reputation: 9163
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 ?
Upvotes: 0
Views: 187
Reputation: 213877
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.
Upvotes: 1