Commit Graph

90 Commits

Author SHA1 Message Date
Koichi Shiraishi
23612165e7
_scripts: handle not installed CommandLineTools (#2914)
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2022-02-28 09:32:39 -08:00
Alessandro Arzilli
e3f4c40bad
_scripts: fix camelToDash in gen-starlark-bindings.go (#2888)
Fix camelToDash so that it handles BuildID and CreateEBPFTracepoint
correctly.
2022-02-02 10:02:27 -08:00
Morten Linderud
8c392d2fdf
Implement source listing from debuginfo (#2885)
* service: Implement BuildID

Parse the BuildID of executables and provides it over the RPC
service.

Signed-off-by: Morten Linderud <morten@linderud.pw>

* command: Support debuinfod for file listing

Signed-off-by: Morten Linderud <morten@linderud.pw>

* debuginfod: create debuginfod package for common code

We remove the duplicated code and provide our a new debuginfod package.

Signed-off-by: Morten Linderud <morten@linderud.pw>

* starlark: Workaround for 'build_i_d'

Signed-off-by: Morten Linderud <morten@linderud.pw>

* command: Ensure we only overwrite path when one has been found

Signed-off-by: Morten Linderud <morten@linderud.pw>

* bininfo: Inline parseBuildID

Signed-off-by: Morten Linderud <morten@linderud.pw>
2022-01-30 13:39:30 -08: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
Herby Gillot
d514b4c6e9
_scripts: add option to disable invoking git during build (#2798)
This is useful to be able to build using Delve's build scripts when
working from within a directory that has been extracted from a source tarball,
or wherever we wouldn't have git history.

This can be invoked as:

```
  go run _scripts/make.go build --no-git
```
2021-12-13 10:24:41 -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
183bb8dffd
TeamCity: disable Windows Defender (#2775)
Shaves off 3 minutes out of every windows build.
2021-11-03 09:49:26 -07:00
Alessandro Arzilli
fe100bcb11
_scripts: fix latestver.py (#2756)
Fix latestver to sort rc and beta versions before normal releases.
2021-10-25 12:38:58 -07: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
29eae8f617
*: clean up staticcheck problems (#2723)
Fix problems that can be fixed, ignore the ones that don't make sense
2021-09-28 12:07:42 -07:00
Alessandro Arzilli
038cd99b73
tests: run staticcheck during tests (#2705) 2021-09-24 15:31:54 -07:00
Claus Lensbøl
4bcb8fb144
terminal/make: Add GOARCH and GOOS arguments (#2696)
This change adds '--GOARCH=[arch]' and '--GOOS=[os]' as arguments for
the make script to simplify the process of cross compilling.
2021-09-13 09:11:45 -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
Alessandro Arzilli
c379296cc8
_scripts: auto check that pkg/proc and runtime are synchronized (#2557)
Adds a script that check automatically that the the assumptions that
pkg/proc makes about runtime are met by the actual runtime, using a
combination of parsing and magic comments.

Also emits a file describing all the struct fields, constants and
variables of the runtime that we use in pkg/proc.
2021-08-23 11:32:02 -07:00
Alessandro Arzilli
f3e76238e3
proc: move breakpoint condition evaluation out of backends (#2628)
* proc: move breakpoint condition evaluation out of backends

Moves breakpoint condition evaluation from the point where breakpoints
are set, inside ContinueOnce, to (*Target).Continue.

This accomplishes three things:

1. the breakpoint evaluation method needs not be exported anymore
2. breakpoint condition evaluation can be done with a full scope,
   containing a Target object, something that wasn't possible before
   because ContinueOnce doesn't have access to the Target object.
3. moves breakpoint condition evaluation out of the critical section
   where some of the threads of the target process might be still
   running.

* proc/native: handle process death during stop() on Windows

It is possible that the thread dies while we are inside the stop()
function. This results in an Access is denied error being returned by
SuspendThread being called on threads that no longer exist.

Delay the reporting the error from SuspendThread until the end of
stop() and only report it if the thread still exists at that point.

Fixes flakyness with TestIssue1101 that was exacerbated by moving
breakpoint condition evaluation outside of the backends.
2021-08-09 10:16:24 -07:00
nd
7462767355
teamcity: report go test exit code on windows (#2638) 2021-08-03 10:42:53 -07:00
Derek Parker
10406f96d5
*: Initial eBPF tracing support (#2625) 2021-07-31 17:16:26 +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
854552fa00
_scripts: change gen-backend_test_health.go to be more stable (#2505)
Change gen-backend_test_health.go so that it only prints the number of
tests skipped and not the total or the percentage.
As it is it causes too many merge conflicts.
2021-05-25 10:49:46 -07:00
Alessandro Arzilli
1962c3a627
TeamCity: fix Windows builds (#2467)
Bintray is shutting down and the URL we used to install mingw is no
longer available. Use chocolatey instead.
2021-05-06 10:05:17 -07:00
Koichi Shiraishi
7d343b6b7b
_scripts: support macOS Big Sur (#2437) 2021-04-17 12:33:33 +02: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
5534839ff7
TeamCity: select latest patch version of go for mac builds (#2363)
Also adds a disabled tip builder for the next-version support branch.
2021-03-01 08:23:05 -08:00
Dmitry Neverov
5360c62869 TeamCity: fix go dist link on mac 2021-02-24 10:27:41 +01:00
nd
baa580b626
Add mac/amd64 & linux/arm64 builders (#2349)
* Add mac/amd64 build

* Set arch requirements for all builds

* Add linux/arm64 build
2021-02-23 11:16:23 +01: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
Alessandro Arzilli
8221250e65
split testing load between more CI services (#2251) 2020-12-16 08:56:15 -08:00
Alessandro Arzilli
69009f87bb
_scripts: remove accidentally committed file (#2268) 2020-12-14 09:13:07 -08:00
Alessandro Arzilli
84328ed870
proc/tests: keep track of tests skipped due to backend problems (#2178)
* proc/tests: keep track of tests skipped due to backend problems

Mark tests skipped due to backend problems and add a script to keep
track of them.

* Travis-CI: add ignorechecksum option to chocolatey command

Looks like a configuration problem on chocolatey's end.
2020-09-24 08:10:20 -07:00
Alessandro Arzilli
e8dbbef374
Travis-CI: bump version of Go used to test linux/386 to 1.15 (#2169)
Fixes #2134
2020-09-10 07:11:19 -07:00
aarzilli
07c9163c52 Travis-CI: hold back version of Go used to test Linux/i386 until fixed
See Issue #2134
2020-08-17 10:25:01 +02:00
aarzilli
46731820df all: bump version and release notes
Thank you to:  @polinasok, @chainhelen, @alexsaezm, @bhcleek,
@letientai299, @gadelkareem and @b00f
2020-07-29 21:59:07 +02:00
Alessandro Arzilli
f9c8f7f55b
Go 1.15 support (#2011)
* proc: start variable visibility one line after their decl line

In most cases variables shouldn't be visible on their declaration line
because they won't be initialized there.
Function arguments are treated as an exception.

This fix is only applied to programs compiled with Go 1.15 or later as
previous versions of Go did not report the correct declaration line for
variables captured by closures.

Fixes #1134

* proc: silence go vet error

* Makefile: enable PIE tests on windows/Go 1.15

* core: support core files for PIEs on windows

* goversion: add Go 1.15 to supported versions

* proc: fix function call injection for Go 1.15

Go 1.15 changed the call injection protocol so that the runtime will
execute the injected call on a different (new) goroutine.

This commit changes the function call support in delve to:

1. correctly track down the call injection state after the runtime
   switches to a different goroutine.
2. correctly perform the escapeCheck when stack values can come from
   multiple goroutine stacks.

* proc: miscellaneous fixed for call injection under macOS with go 1.15

- create copy of SP in debugCallAXCompleteCall case because the code
  used to assume that regs doesn't change
- fix automatic address calculation for function arguments when an
  argument has a spurious DW_OP_piece at entry
2020-07-28 09:19:51 -07:00
aarzilli
55543e2570 Makefile: reduce test timeout when TRAVIS==true
Reduces test timeout by one minute so that Go will timeout before
Travis-CI and report useful informations about the hang.
2020-04-17 09:20:55 -07:00
Derek Parker
85c34e47ee *: mv scripts _scripts
Instead of selectively excluding this directory, hide it from the go
tooling by applying the "_" prefix.
2020-03-28 20:28:51 +01:00