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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题