Created
July 16, 2018 11:28
-
-
Save dlsniper/5549e65cb2e85d72fd8e9d2dbea4b311 to your computer and use it in GitHub Desktop.
Shell Script to perform tasks on binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# Compile the using one of these commands: | |
# for Go 1.10 or later | |
go build -gcflags "all=-N -l" -o /tmp/demo github.com/app/demo | |
# for Go 1.9 or earlier | |
# go build -gcflags "-N -l" -o /tmp/demo github.com/app/demo | |
# Perform the binary manipulation here | |
# Now launch the binary using delve | |
dlv --listen=:2345 --headless=true --api-version=2 exec /tmp/demo | |
# Then go to the IDE and use the Go Remote run configuration type to | |
# connect to the debugger and start the debugging session. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment