Skip to content

Instantly share code, notes, and snippets.

@emaxerrno
Forked from nexneo/gobreak.sh
Created April 30, 2013 01:01
Show Gist options
  • Save emaxerrno/5485983 to your computer and use it in GitHub Desktop.
Save emaxerrno/5485983 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Demo http://ascii.io/a/3019
# build with debug flags
go build -gcflags "-N -l" -o out
# find the debugger comments
awk '/\/\/debugger/ { print "break " FILENAME ":" FNR; }' `find $PWD -name "*.go" | xargs` > .breakpoints
# launch gdb
gdb -x .breakpoints --args out "$@"
# clean up
rm .breakpoints out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment