Commit Graph

17 Commits

Author SHA1 Message Date
Alessandro Arzilli
97a7455192
_scripts: fix CI on go1.19/linux/386 (#3100)
Go 1.19 is broken on linux/386 with some C compilers, this is a
workaround for our build script. See:

https://github.com/golang/go/issues/52919

Also fix TestBuild if the first message reported by delve is not the
message that indicates the server is listening.
2022-08-15 09:40:25 -07:00
Derek Parker
db9770fe9d
_scripts: fix command to download Go version (#3099)
We should exclude rc/beta versions as we already run tests
against tip, we don't explicitly test RC versions.
2022-08-09 20:06:42 +02:00
Alessandro Arzilli
5452c30fac
proc/internal/ebpf: drop dependency on cgo (#3072)
The ebpf implementations uses cgo, but only to access some C struct
definitions. Instead of using cgo simply duplicate the defintion of
those two structs in Go and add a test to check that the duplicate
definitions remain synchronized.

Fixes #2827
2022-07-22 19:39:18 +02:00
Alessandro Arzilli
2d9a9d439d
_scripts/test_linux.sh,_scripts/test_windows.ps1: always return exit code 0 when testing on tip (#2997)
Same as what we do for test_mac.sh
2022-05-03 10:35:24 -07:00
Alessandro Arzilli
4a94b3eff2
Updates for go1.18beta1 (#2831)
* go.mod: update golang.org/x/tools to v0.1.8

Fixes TestGeneratedDoc on go1.18

* TeamCity: bump test matrix

Add 1.18 to test matrix. Remove 1.15 from test matrix and from support range.

* proc,tests: update for regabi on arm64 and 386

Make sure that stacktrace registers always contain the PC register of
the current frame, even though the debug_frame rules might not specify
it on architectures that use a link register.
The PC register is needed to look up loclist entries for variable
evaluation.

* goversion: bump maximum supported Go version to 1.18

* proc: disable asyncpreempt on linux/arm64

Asyncpreempt on linux/arm64 can sometimes restart a sequence of
instructions which will make breakpoint appear to be hit twice in some
cases.
2021-12-22 10:26:21 -08:00
Alessandro Arzilli
b69bcf53d6
_scripts: fix test_linux.sh version check (#2785)
The version check to disable the buildvcs option is wrong, it doesn't
matter now but it will start failing when 1.18.1 is released.
2021-11-24 13:44:49 -08:00
Alessandro Arzilli
389cccf08b
TeamCity: fix scripts selecting Go version (#2804)
s/golang.org/go.dev/
2021-11-24 13:09:43 -08:00
Alessandro Arzilli
8ebd2d83ae
Misc fixes for test problems (#2751)
* service/dap: remove deadlock in TestLaunchDebugRequest

Fixes #2746

* terminal: fix TestScopePrefix flakiness

When there are more than 10 frames api.PrintStack will prefix the
output with spaces to right justify the frame number, which confuses
TestScopePrefix.

* _scripts: pass -buildvcs for Go 1.18 and later on TeamCity

Go 1.18 will try to stamp builds with the VCS version, this doesn't
work on TeamCity because the checkout isn't a valid repository (but
looks like it).
Pass -buildvcs=false to disable this feature.

* proc: switch to goroutine stack if first frame's func can not be found

If the first frame on the system stack can not be resolved to a
function switch directly to the goroutine stack.
2021-10-18 13:17:47 -07:00
aarzilli
6a282112cc TeamCity: enable tests on go-tip 2021-10-02 15:44:30 +02:00
Alessandro Arzilli
038cd99b73
tests: run staticcheck during tests (#2705) 2021-09-24 15:31:54 -07:00
Derek Parker
1b2f7f0051
pkg/proc: Parse Goroutine ID in eBPF tracer (#2654)
This patch enables the eBPF tracer backend to parse the ID of the
Goroutine which hit the uprobe. This implementation is specific to AMD64
and will have to be generalized further in order to be used on other
architectures.
2021-08-24 14:53:27 +02:00
nd
150ef04177
TeamCity: prefer go rc builds over beta (#2619)
Works around https://github.com/golang/go/issues/47367.
2021-07-24 11:14:45 -07:00
Alessandro Arzilli
1399f20585
TeamCity: add go1.17 to test matrix, disable go-tip builds (#2576) 2021-07-12 09:48:11 -07:00
Alessandro Arzilli
f0a32c8e1b
Go 1.17 support branch (#2451)
* proc: support new Go 1.17 panic/defer mechanism

Go 1.17 will create wrappers for deferred calls that take arguments.
Change defer reading code so that wrappers are automatically unwrapped.

Also the deferred function is called directly by runtime.gopanic, without going through runtime.callN which means that sometimes when a panic happens the stack is either:

0. deferred function call
1. deferred call wrapper
2. runtime.gopanic

or:

0. deferred function call
1. runtime.gopanic

instead of always being:

0. deferred function call
1. runtime.callN
2. runtime.gopanic

the isPanicCall check is changed accordingly.

* test: miscellaneous minor test fixes for Go 1.17

* proc: resolve inlined calls when stepping out of runtime.breakpoint

Calls to runtime.Breakpoint are inlined in Go 1.17 when inlining is
enabled, resolve inlined calls in stepInstructionOut.

* proc: add support for debugCallV2 with regabi

This change adds support for the new debug call protocol which had to
change for the new register ABI introduced in Go 1.17.

Summary of changes:
- Abstracts over the debug call version depending on the Go version
  found in the binary.
- Uses R12 instead of RAX as the debug protocol register when the binary
  is from Go 1.17 or later.
- Creates a variable directly from the DWARF entry for function
  arguments to support passing arguments however the ABI expects.
- Computes a very conservative stack frame size for the call when
  injecting a call into a Go process whose version is >=1.17.

Co-authored-by: Michael Anthony Knyszek <mknyszek@google.com>
Co-authored-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>

* TeamCity: enable tests on go-tip

* goversion: version compatibility bump

* TeamCity: fix go-tip builds on macOS/arm64

Co-authored-by: Michael Anthony Knyszek <mknyszek@google.com>
2021-07-08 08:47:53 -07:00
Alessandro Arzilli
623667b0f4
*: Skipped tests review (#2430)
Delete tests for old versions of Go that are no longer run, remove skip
from tests that seemingly work.
2021-04-12 14:56:12 -07:00
Alessandro Arzilli
715224cea0
Change TeamCity test matrix and drop appveyor/travis-ci configurations (#2315)
* TeamCity: change test matrix and test scripts

Changes test matrix to test:

* 1.13 through 1.16 on linux/amd64
* 1.15, 1.16 on windows/amd64
* 1.15 on linux/386

Also includes tests on go-tip for windows/amd64 and linux/amd64
(currently disabled, but can be turned on in a PR).

Changes test scripts to automatically select the latest patch version
of Go.

* CI: remove Travis-CI and Appveyor configuration
2021-01-25 20:48:27 -08:00
Artem Khvastunov
f2ec3e49a8
Introduce TeamCity builds (#2298)
* add -json flag when running tests on TeamCity

* introduce TeamCity builds

* restore gdbserial constants for 386

Otherwise compilation fails.

* skip TestAttachRequest on Windows as it never finishes

* run tests on 1.16beta1
2021-01-18 07:48:06 -08:00