doudai8083 2019-04-16 16:27
浏览 34

从Visual Studio调试Raspberry Pi中的Golang二进制文件

I am cross-compiling the following sample code from visual studio in raspberry pi(Raspbian GNU/Linux 9 stretch) using Windows 10 OS:

package main
import "fmt"
func main() {
    fmt.Println("Hello World, 世界")
}

In order to run this in raspberry pi from VScode, I am doing the following:

  • specifying env:GOARCH and env:GOOS
  • go build main.go
  • copying generated binary to raspberry pi directory
  • logging into the pi and making the binary executable
  • logging into the pi and running the binary This is working well and I am getting the desired print statement.

The problem I am facing is with debugging the code within raspberry pi from visual studio. I am able to debug the code in visual studio by installing delve, going to the current go directory in Windows, and running dlv debug main.go. However, I am completely lost on how to set breakpoint in visual studio, build and debug the code in raspberry pi?

I did look up for tutorials online and tried some, however, none of them worked for me. Any help/link/guidance would be highly appreciated.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度