I have launched GDB using subprocess.call methond in python .Can any one help how to pass commands to gdb (like 'info threads') from python script.
Asked
Active
Viewed 309 times
1 Answers
1
It is better to use Pexpect module if you want to interact with interactive shells.
But I suggest you to use Python bindings that shipped with gdb.
infothreads.py:
import gdb
gdb.execute('info threads')
gdb.execute('continue')
Run it using -x
option of gdb:
gdb -x infothreads.py -p 21686
Documentation on Python bindings may be found here: Python API

myaut
- 11,174
- 2
- 30
- 62