Skip to content

Instantly share code, notes, and snippets.

@pallas
Last active July 15, 2020 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pallas/035bf6beb9bbf0872d84b38ebacb0cde to your computer and use it in GitHub Desktop.
Save pallas/035bf6beb9bbf0872d84b38ebacb0cde to your computer and use it in GitHub Desktop.
GDB wrapper to produce backtrace automatically
#!/bin/bash
# SPDX-License-Identifier: Unlicense
# Author: Derrick Lyndon Pallas <derrick@pallas.us>
[ $# -gt 0 ] &&
exec gdb "$1" --return-child-result --silent --batch \
--ex "run $([ $# -gt 1 ] && printf '%q ' "${@:2}")" \
--ex bt \
2>/dev/null
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment