"# mit-6.824"
-
Build
wc.go
with these parameters-gcflags="all=-N -l"
. Compiled version must have same flags as debug run.- What this looks like:
go build -gcflags="all=-N -l" --buildmode=plugin ../mrapps/wc.go
- What this looks like:
-
Now run Delve on a separate terminal (make sure to install before proceeding). Use the following command:
dlv debug --headless --listen=:2345 --api-version=2 --accept-multiclient mrsequential.go -- wc.so pg*.txt
Note that this will run on port 2345 (this is the default debug port on GoLand IDE). The
--
separator is needed for application arguments that needs to be passed intomain
function -
Now go to GoLand IDE, add breakpoints, and start a debugger instance on port 2345 using the Go Remote presets.