Skip to content

Instantly share code, notes, and snippets.

@dboyliao
Forked from jserv/exec_with_gdb.sh
Created April 27, 2017 08:19
Show Gist options
  • Save dboyliao/d8f72355b5d211b268a9f1828b1b1962 to your computer and use it in GitHub Desktop.
Save dboyliao/d8f72355b5d211b268a9f1828b1b1962 to your computer and use it in GitHub Desktop.
GDB runner
# Execute an executable under gdb, printing a call stack if we get a crash.
gdb -return-child-result -quiet -batch \
-ex "set env MALLOC_CHECK_=3" \
-ex "set print thread-events off" \
-ex run \
-ex "thread apply all backtrace full" \
-ex "quit" \
$*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment