Created
December 6, 2024 21:39
-
-
Save iTrooz/f30ed338b975560ad205623cb3ffa61c to your computer and use it in GitHub Desktop.
gdb run command with classic syntax and auto exit if ok
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Auto run command (syntax is `gdbcmd <binary> <args>`) | |
# Auto exit if the program exits with 0 | |
gdb "$1" \ | |
-ex 'python gdb.events.exited.connect(lambda x : gdb.execute("quit") if x.exit_code == 0 else None)' \ | |
-ex "run ${*:2}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment