Skip to content

Active breakpoints ignored when running debug launch file. [apple architecture] #3923

@mpurnyn

Description

@mpurnyn

I have read through similar issues, stack overflow, and the troubleshooting guides, but no solution seems to work.

I have no issue with building/running go projects, but if I try to set a breakpoint then it's never triggered.


What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.24.9 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • 0.20.0
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.106.0
      ac4cbdf48759c7d8c3eb91ffe6bb04316e263c57
      arm64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.50.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    `# Tools Configuration

Environment

GOBIN: undefined
toolsGopath:
gopath: /Users/peterpurnyn/go
GOROOT: /usr/local/go
PATH: /Users/peterpurnyn/.local/bin:/usr/local/sessionmanagerplugin/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/go/bin:/Users/peterpurnyn/go/bin/darwin_amd64

Tools

go:	/usr/local/go/bin/go: go version go1.24.9 darwin/arm64

gopls:	/Users/peterpurnyn/go/bin/gopls	(version: v0.20.0 built with go: go1.24.9)
gotests:	/Users/peterpurnyn/go/bin/gotests	(version: v1.6.0 built with go: go1.24.9)
impl:	/Users/peterpurnyn/go/bin/impl	(version: v1.4.0 built with go: go1.24.9)
goplay:	/Users/peterpurnyn/go/bin/goplay	(version: v1.0.0 built with go: go1.24.9)
dlv:	/Users/peterpurnyn/go/bin/dlv	(version: v1.25.2 built with go: go1.24.9)
staticcheck:	/Users/peterpurnyn/go/bin/staticcheck	(version: v0.6.1 built with go: go1.24.9)

Go env

Workspace Folder (GolandProjects): /Users/peterpurnyn/GolandProjects

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/peterpurnyn/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/peterpurnyn/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/0x/m8d_mjhd293dkycxbx9tqkrh0000gn/T/go-build477735961=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/peterpurnyn/go/pkg/mod'
GONOPROXY='gitlab.com/homeaware/*'
GONOSUMDB='gitlab.com/homeaware/*'
GOOS='darwin'
GOPATH='/Users/peterpurnyn/go'
GOPRIVATE='gitlab.com/homeaware/*'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/peterpurnyn/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.9'
GOWORK=''
PKG_CONFIG='pkg-config'
`

Share the Go related settings you have added/edited

none

Describe the bug

A clear and concise description of what the bug.

  • Breakpoints don't trigger when debugging.
    A clear and concise description of what you expected to happen.
  • Breakpoints should stop.

Steps to reproduce the behavior:

  1. Set a breakpoint in the for loop for this test:
main.go
package main

import (
	"fmt"
)

//TIP <p>To run your code, right-click the code and select <b>Run</b>.</p> <p>Alternatively, click
// the <icon src="AllIcons.Actions.Execute"/> icon in the gutter and select the <b>Run</b> menu item from here.</p>

func main() {
	//TIP <p>Press <shortcut actionId="ShowIntentionActions"/> when your caret is at the underlined text
	// to see how GoLand suggests fixing the warning.</p><p>Alternatively, if available, click the lightbulb to view possible fixes.</p>
	s := "gopher"
	fmt.Printf("Hello and welcome, %s!\n", s)

	for i := 1; i <= 5; i++ {
		//TIP <p>To start your debugging session, right-click your code in the editor and select the Debug option.</p> <p>We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
		// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.</p>
		fmt.Println("i =", 100/i)
	}
}
  1. create a launch file
launch.json
    {
      "name": "TestProject Debug",
      "type": "go",
      "request": "launch",
      "mode": "debug",
      "program": "/Users/peterpurnyn/GolandProjects/testproject/main.go",
      "trace": "verbose",
      "buildFlags": [
        "-gcflags=all=-N -l"
      ]
    }

3. run the debugger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions