Skip to content

Instantly share code, notes, and snippets.

@jserv
Created April 26, 2017 19:37
Show Gist options
  • Save jserv/79fbea8f75c750915c3ad1b6bd429cce to your computer and use it in GitHub Desktop.
Save jserv/79fbea8f75c750915c3ad1b6bd429cce 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