Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- gdb_command = ['gdb', './cutted_bin']
- gdb_script = """
- run
- generate-core-file /mnt/core-dump
- quit
- """
- try:
- result = subprocess.run(
- gdb_command,
- input=gdb_script,
- text=True,
- check=True,
- capture_output=True
- )
- except subprocess.CalledProcessError as e:
- print('Error:', e.stderr)
- print('Return code:', e.returncode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement