Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Start bitcoind in a screen in a debugger
set disable-randomization off
set $_exitcode = -999
set height 0
handle SIGTERM nostop print pass
handle SIGPIPE nostop
define hook-stop
if $_exitcode != -999
shell echo | mail -s "NOTICE: app has stopped on unhandled signal" root
echo .gdbinit: running app\n
# Start bitcoind in a screen in a debugger
# This works like -daemon, except that it is possible to jump into the debugger at any time
# by attaching to the screen (screen -r). On a crash the debugger will keep running,
# on a normal exit it will quit automatically.
screen -d -m gdb -x run.gdbscript -args ./bitcoind -datadir=/usb/bitcoin

This comment has been minimized.

Copy link
Owner Author

laanwj commented Feb 24, 2017

Important: don't forget set disable-randomization off in the gdb script. By default, GDB disables ASLR, which reduces hardening against various forms of exploitation. This is not a good idea for network software such as bitcoin core, so be sure to turn off that "feature".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.