php中文网 | cnphp.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 346|回复: 0

Arm32进行远程调试

[复制链接]

2645

主题

2652

帖子

9404

积分

管理员

Rank: 9Rank: 9Rank: 9

UID
1
威望
0
积分
6637
贡献
0
注册时间
2021-4-14
最后登录
2024-5-3
在线时间
670 小时
QQ
发表于 2022-7-28 09:04:05 | 显示全部楼层 |阅读模式
Arm 32bit Goland 远程调试
32位支持issue
Goland配置Go remote支持文档
https://mojotv.cn/go/golang-remote_debug

Delve
官方版本delve并不支持arm-32位,直接安装会提示架构不符合

架构判定文件为https://github.com/go-delve/delv ... support_sentinel.go

个人水平有限,没有太明白这里的go build构建约束,欢迎大佬在评论区解读

注:第二行是老式的构建约束写法,大家看第一行就行了
// This file is used to detect build on unsupported GOOS/GOARCH combinations.

//go:build (!linux && !darwin && !windows && !freebsd) || (linux && !amd64 && !arm64 && !386) || (darwin && !amd64 && !arm64) || (windows && !amd64) || (freebsd && !amd64)
// +build !linux,!darwin,!windows,!freebsd linux,!amd64,!arm64,!386 darwin,!amd64,!arm64 windows,!amd64 freebsd,!amd64

package your_operating_system_and_architecture_combination_is_not_supported_by_delve


在issue下找到该仓库,实装后可以正常运行,
https://github.com/puppywang/delve

下载后进行安装make install

启动
Goland远程启动程序A
## goland 终端打印
GOROOT= #gosetup
GOPATH=/root/go #gosetup
/root/Env/go/bin/go build -i -o /root/**/executables-7agJx2Zna4/___11_linux demo/cmd/demo #gosetup
go: -i flag is deprecated
/root/****/executables-nq690aaBJS/___11_linux


## 查下进程id,后面用
ps axu|grep ___11_linux

获得`exe_PID`

远程终端启动dlv
#PID 为程序A进程
dlv --listen=:5604 --headless=true --api-version=2 --check-go-version=false attach 获得`exe_PID`

//TODO 补充命令参数作用
Goland配置Go remote
Host 远程部署IP
port 5604(上面)

然后即可进行远程调试





上一篇:售价高达1088元:微软开卖正版Win11
下一篇:JAVA定时任务原理入门
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|php中文网 | cnphp.com ( 赣ICP备2021002321号-2 )51LA统计

GMT+8, 2024-5-3 18:19 , Processed in 0.185676 second(s), 38 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

申明:本站所有资源皆搜集自网络,相关版权归版权持有人所有,如有侵权,请电邮(fiorkn@foxmail.com)告之,本站会尽快删除。

快速回复 返回顶部 返回列表