New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARM support #118
Comments
yes please for ARM processors. I'd love to help but my bandwidth is limited at the moment. |
If this helps, when compiling, I get:
|
Can anyone familiar with the technical hurdles give a high level breakdown of what they are? |
@dt-rush The overall technical hurdle is adding in the arm64 disassembler golang files in /pkg/proc/disasm_arm64.go. You can find my work on the forked delve repo, arm64_fix branch.
|
I will probable be asking too much, but ARM32 would be nice too. |
whats the status here, is there any way people can contribute to help? I want to code on a chromebook but this makes it hard |
@gidoBOSSftw5731, I suspect looking at the repository @willwp linked would be a good start. If you find you have the understanding and time necessary to contribute, you should be able to do so by making pull requests from a forked repository in the usual way. If you find that you (like me, FWIW) don't know enough to contribute that way, then you could wait until @willwp's first bullet point is complete and work starts on the second, the testing one. At that point, assuming it arrives, you will be able to clone and build some branch of delve on your Chromebook and try it out, reporting bugs as you find them. |
:-(
|
It would be really nice to debug my go code on a Raspberry PI or on an ARM simulator locally. Sometimes I dump out before I can pinpoint where the bug is and have to cycle through a lot of slow recompiling/guesswork to spot the issue. |
Do we have progress on this? |
I looked at @willwp branch and it appears to be a first attempt, simply copying the amd64 code and beginning to make some changes. ARM works differently to X86. The CALL equivalents are BL and BLR which take a 26bit signed immediate and a register ID respectively. disasm seems to have some direct expectations on the attributes exposed by Instr. Len for instance is, I think, 32bits or 4 bytes at all times? Therefore it doesn't exist in the struct. Size() should in that case return 4 for everything and Size() calls should replace references to Len in Disasm. This could be confirmed by looking at the instr.json which lists either bit values or argument types and bit lengths. ARM memory doesn't have the same memory segmentation as Intel, so there is simply one 64 bit register and not a segment and offset. I wish I could dedicate time to this, it is a good cause. |
That was my first try, and I plan on reading up on
https://golang.org/doc/asm#arm64 and making it my changes correct.
…On Sun, Dec 30, 2018 at 9:52 PM Faye Salwin ***@***.***> wrote:
I looked at @willwp <https://github.com/willwp> branch and it appears to
be a first attempt, simply copying the amd64 code and beginning to make
some changes. ARM works differently to X86. The CALL equivalents are BL and
BLR which take a 26bit signed immediate and a register ID respectively.
disasm seems to have some direct expectations on the attributes exposed by
Instr. Len for instance is, I think, 32bits or 4 bytes at all times?
Therefore it doesn't exist in the struct. Size() should in that case return
4 for everything and Size() calls should replace references to Len in
Disasm. This could be confirmed by looking at the instr.json which lists
either bit values or argument types and bit lengths. ARM memory doesn't
have the same memory segmentation as Intel, so there is simply one 64 bit
register and not a segment and offset. I wish I could dedicate time to
this, it is a good cause.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/derekparker/delve/issues/118#issuecomment-450605606>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AmsZ3_dWjOatseLva7CnBe7oiQU5JfA-ks5u-YoYgaJpZM4EOwEa>
.
|
I'm running into this issue on a raspberry pi 3:
$ go version
go version go1.12.4 linux/arm64
$ uname -a
Linux kali 4.19.29-Re4son-v8+ #6 SMP PREEMPT Wed Mar 27 00:15:50 UTC 2019 aarch64 GNU/Linux |
I use VSCode on my Arm64 Chromebook in Crostini, and the Go extension depends on delve. What would be the best way to stub it out for now so I can at least run my code from the editor? |
I am currently investigating porting to other arches, the first would be ARM64. That is unless someone else out there is currently making progress on this port. I have a local branch that I've been testing my changes on while I'm working. |
Would be super nice to have Delve in any kind of small Linux box like RPi, Chromebooks, or even some Android phones/tablets! I am sure that many of Go/Delve users would like to help Delve-ARM as tester as I am willing to. |
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
As proc/native is arch related, it should move some functions to arch-relate file. And this patch can help us to separate the architecture code, make code tidy. So that the merge of arm64 code later will not cause chaos.(#118)
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
Now, you can debug arm64 with all delve commands except stack command(like bt, frame...). Stacktrace is start pushing. |
@hengwu0 any chance for arm32 support? |
Sorry, i have no idea on arm32. |
I finally installed the ARM64 version on RPI4 that runs Ubuntu The version info seems like this after installation:
My tip is that, the manual installation should be done instead of go get.
I will keep using the ARM version and hopefully I can fully use the power. Thanks for @hengwu0, @derekparker and to whom put so much effort for this. Edit: the version of Ubuntu used from 19.04 => 19.10 |
@bus710 what is the exact "undefined arch" error you are getting with |
I will probably try to reproduce the message after work. |
It's because go get will retrieve the latest tagged version by default and 1.3.x do not have ARM support, there is no need to look further into this, it will be resolved when we tag 1.4.0, which hopefully is soon after Go 1.14 is released. |
Closing this as we do have ARM support now, and with the latest tagged release it is go get'able. |
Hi! $ go get -v -u github.com/go-delve/delve/cmd/dlv
github.com/go-delve/delve (download)
package github.com/go-delve/delve/pkg/proc/native: found packages native (proc.go) and your_operating_system_and_architecture_combination_is_not_supported_by_delve (support_sentinel.go) in /opt/sources/gopath/src/github.com/go-delve/delve/pkg/proc/native If I try and get the @latest version, I get the following output: $ go get -v -u github.com/go-delve/delve/cmd/dlv@latest
# github.com/go-delve/delve/pkg/proc/native
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/proc.go:164:13: cannot use v (type *Thread) as type proc.Thread in append:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/proc.go:172:2: cannot use th (type *Thread) as type proc.Thread in return argument:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/proc.go:177:12: cannot use dbp.currentThread (type *Thread) as type proc.Thread in return argument:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/proc.go:265:2: cannot use trapthread (type *Thread) as type proc.Thread in return argument:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/proc.go:275:43: cannot use dbp.currentThread (type *Thread) as type proc.Thread in argument to proc.GetG:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/threads.go:131:14: t.SetPC undefined (type *Thread has no field or method SetPC)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/threads.go:135:42: cannot use t (type *Thread) as type proc.Thread in argument to bp.CheckCondition:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/threads.go:137:26: cannot use t (type *Thread) as type proc.Thread in argument to proc.GetG:
*Thread does not implement proc.Thread (missing SetDX method)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/threads.go:167:9: undefined: registers
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/threads.go:173:10: t.restoreRegisters undefined (type *Thread has no field or method restoreRegisters, but does have RestoreRegisters)
../../pkg/mod/github.com/go-delve/delve@v1.4.0/pkg/proc/native/threads.go:173:10: too many errors This is the output of GO111MODULE="on"
GOARCH="arm"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/opt/sources/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/sources/go/v1.13.5"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/sources/go/v1.13.5/pkg/tool/linux_arm"
GCCGO="gccgo"
GOARM="6"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build260717664=/tmp/go-build -gno-record-gcc-switches" And this is the output of Linux smartbit 4.19.62-sunxi #5.92 SMP Wed Jul 31 22:07:23 CEST 2019 armv7l GNU/Linux |
Same problem on Raspbian 10 also; I installed go 1.14 via snap. Trying
|
Seems like we need an ARM32 issue we can redirect these comments to? |
I think the FAQ should be updated. I was surprised when I read that arm64 was not supported right after successfully using delve on a linux/arm64 platform (which is awesome!). I don't know if it is fully supported on all OS variants yet, so I didn't want to open a drive by PR. |
* init * mm7 port * rpcbuilder listen host * container names fix for jaeger * revert port mapping in dev * template * container_port, container_name struct fields * rpc_service -> rpc_address env vars/ struct fields * charts * trigger build rerun * struct fields * more fields and naming
go-delve#119) * added dev env container for webhook worker * using ContainerName * Squashed commit of the following: commit 504164e Author: Elliot <elliot@burstsms.com> Date: Thu Jan 28 16:23:29 2021 +1100 RPC infra simplification (go-delve#118) * init * mm7 port * rpcbuilder listen host * container names fix for jaeger * revert port mapping in dev * template * container_port, container_name struct fields * rpc_service -> rpc_address env vars/ struct fields * charts * trigger build rerun * struct fields * more fields and naming * removed extra blank line * de-lint * changing the webhook message queue exchange name to "webhook-post" * remove ports not required until the health check PR is created
As proc/native is arch related, it should move some functions to arch-relate file. And this patch can help us to separate the architecture code, make code tidy. So that the merge of arm64 code later will not cause chaos.(go-delve#118)
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
As proc/native is arch related, it should move some functions to arch-relate file. And this patch can help us to separate the architecture code, make code tidy. So that the merge of arm64 code later will not cause chaos.(go-delve#118)
* delve now can be built to arm64-arch and running on linux-arm64 OS. * arm64 general-purpose registers have completed. * arm64 disasm has completed. Co-authored-by: tykcd996 <tang.yuke@zte.com.cn> Co-authored-by: hengwu0 <wu.heng@zte.com.cn>
Add support for ARM processors.
The text was updated successfully, but these errors were encountered: