Skip to content
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

Support debugging i386 executables on amd64 host #2095

Open
dennwc opened this issue Jul 5, 2020 · 5 comments
Open

Support debugging i386 executables on amd64 host #2095

dennwc opened this issue Jul 5, 2020 · 5 comments

Comments

@dennwc
Copy link

dennwc commented Jul 5, 2020

  1. What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.4.1
Build: 708eadd5538edd222d8553b08b47c295474f38fa
  1. What version of Go are you using? (go version)?
go version go1.13.12 linux/amd64
  1. What operating system and processor architecture are you using?

Delve is running on linux/amd64, while debugging the program for linux/386 (running on the same host).

  1. What did you do?

Run the debugging session using Goland:

dlv --listen=0.0.0.0:45155 --headless=true --api-version=2 --check-go-version=false --only-same-user=false exec /tmp/___go_build_cmd -- --some-flags
  1. What did you expect to see?

A running debugging session, as usual.

  1. What did you see instead?
panic: runtime error: slice bounds out of range

goroutine 6 [running]:
github.com/go-delve/delve/pkg/dwarf/frame.parseFDE(0xc0011fa0a0, 0xbe0858)
        /mnt/agent/work/4c3e5e3eabfaf2d2/pkg/dwarf/frame/parser.go:88 +0x2db
github.com/go-delve/delve/pkg/dwarf/frame.Parse(0xc000e94000, 0xa54c4, 0xa54c4, 0xcbbb40, 0x11af820, 0x0, 0x8, 0x0, 0x0, 0x0)
        /mnt/agent/work/4c3e5e3eabfaf2d2/pkg/dwarf/frame/parser.go:36 +0x109
github.com/go-delve/delve/pkg/proc.(*BinaryInfo).parseDebugFrameElf(0xc0001903c0, 0xc0001d40b0, 0xc000033540, 0xc000041ed0)
        /mnt/agent/work/4c3e5e3eabfaf2d2/pkg/proc/bininfo.go:1186 +0x234
created by github.com/go-delve/delve/pkg/proc.loadBinaryInfoElf
        /mnt/agent/work/4c3e5e3eabfaf2d2/pkg/proc/bininfo.go:1142 +0x3d4
@chainhelen
Copy link
Contributor

It do rely on runtime.GOOS, runtime.GOARCH instead of executable at present.

@aarzilli aarzilli changed the title Runtime error: slice bounds out of range Support debugging i386 executables on amd64 Jul 6, 2020
@aarzilli aarzilli changed the title Support debugging i386 executables on amd64 Support debugging i386 executables on amd64 host Jul 6, 2020
@dennwc
Copy link
Author

dennwc commented Jul 6, 2020

Thanks for the insight!

Do you mean the environment variables, or the constants in the runtime?

If the later, I guess I will need to run Delve for 386. Or I can send a patch to allow the environment variables first.

@chainhelen
Copy link
Contributor

Delve need to be compiled on i386 platform or cross compile for i386 (please note dlv use cgo when cross compile) .

@dennwc
Copy link
Author

dennwc commented Jul 7, 2020

I can confirm that Delve works with that binary if 386 version of the tool is used.

@dennwc
Copy link
Author

dennwc commented Jul 24, 2020

I opened an issue for Goland, to consider bundling 386 Delve version in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants