Skip to content

Instantly share code, notes, and snippets.

@nexneo
Forked from icholy/gobreak.sh
Last active December 16, 2015 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nexneo/5484555 to your computer and use it in GitHub Desktop.
Save nexneo/5484555 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
@icholy
Copy link

icholy commented Apr 29, 2013

nice catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment