Solve the problem that M1 Mac can’t debug when using GoLand

The general error information is as follows:

API server listening at: [::]:57824
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1200.0.44
 for x86_64.
error: failed to launch process /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver: (os/kern) invalid argument
Exiting.

I use go 1.16, which supports arm architecture. The reason for this problem is that go debug needs DLV tool, which also needs arm architecture.

The easiest way to solve this problem is to go to the official website to update GoLand. Pay attention to go to the official website to download the latest arm version again. Usually, the update prompted in the IDE can only be regarded as a patch, not a big version update. In this way, the debugging tools of IDE are adapted to arm architecture.

Of course, due to various reasons that cannot be described, some users may not be suitable to go to the official website to update, so you can refer to this link   https://youtrack.jetbrains.com/issue/GO-10235#focus =Comments-27-4632451.0-0

Download the DLV debugging tool of arm architecture, and then configure it in IDE.

Read More: