Commit Graph

79 Commits

Author SHA1 Message Date
Alessandro Arzilli
2e88b7ead3
tests: fix tests on Go 1.23 (#3697)
* Adjust rtype.go script to handle constants moved to internal/abi from
  runtime
* Remove tests in service/dap/server_test that relied on knowledge of
  the internal layout of channels.
2024-04-11 09:40:57 -07:00
Alessandro Arzilli
5bd835a801
*: misc fixes for go1.23 (#3663)
- skip staticcheck on go1.23 for now
- fix reading interface values in go1.23
- sync list of waitreasons from go1.23
2024-02-22 11:35:15 -08:00
ardnew
dab870bd96
make.go: do not recodesign when rebuilding (#3639) 2024-01-19 11:51:22 -08:00
Alessandro Arzilli
1a1e215fac
TeamCity: speed up ppc64le CI (#3622)
The builder is currently spending 15 to 20 minutes installing gcc and
upgrading packages every time we run the tests.
Because of this the build fails sometimes by running out of time.
This change reduces that to 5 minutes by:

* switching from curl to wget (which seems to have fewer dependencies)
* not installing gcc on ppc64le
* skipping tests that depend on gcc or other binutils
2024-01-09 14:13:00 -08:00
Alessandro Arzilli
a8ee87e473
*: remove checks for TRAVIS env variable (#3568)
We had a few checks left over for the TRAVIS variable that detected if
we were running under the TravisCI build system.
This variable hasn't been set since 2020.
2023-11-16 10:42:41 -08:00
Alessandro Arzilli
90a1571f88
CI: update staticcheck version (#3533)
Update staticcheck version and re-enable TestStaticcheck on Go 1.22.
2023-10-20 10:05:58 -07:00
Oleksandr Redko
255afbfdb7
all: remove obsolete build tags "// +build" (#3513) 2023-10-03 08:50:11 -07:00
Oleksandr Redko
899ba72505
all: replace deprecated io/ioutil with io and os (#3509) 2023-09-25 11:41:59 -07:00
Oleksandr Redko
ffd1c396c2
_scripts: remove unnecessary os.ExpandEnv (#3504) 2023-09-19 09:30:18 -07:00
Alessandro Arzilli
32b937c953
teamcity: misc changes to CI (#3476)
- add architecture rule for ppc64le so that incompatible agents don't
  pick up the build
- disable PIE tests on linux/ppc64le (the tests claim it doesn't work)
- enable PIE tests on darwin/amd64 now that the entry point calculation
  has been fixed
- remove dependency on wget and curl in the test script for linux to
  reduce test time
- only install git in the linux test script when we need it
- remove staticcheck from linux/ppc64le builds (it takes almost 5
  minutes between installation and execution and makes the test timeout
  sometimes)
- drop windows/arm64/tip build, the windows/arm64 build is broken
  anyway and since there is only one agent it makes CI runs slow
- drop linux/ppc64le/tip build, there is only one agent, it's slow and
  it will always timeout. CI runs in excess of 1h are too long.
2023-08-22 09:24:25 -07:00
Alessandro Arzilli
891a1f080d
goversion,teamcity: update test matrix and fix build scripts (#3463)
Update test matrix to remove 1.18 and add 1.21, fix build scripts to
deal with the new format returned by:
	https://golang.org/VERSION?m=text
which now has an extra second line with the time.
2023-08-11 08:52:35 -07:00
Derek Parker
e49c81cc5d
*: Fix ppc64le test runs (#3460)
We must pass the build tag through during the 'vet' check, and
additionally there was some extra commands at the end of test_linux.sh
that were not necessary.
2023-08-11 08:51:28 -07:00
Alessandro Arzilli
caf6df0eb9
Documentation,cmd/dlv: clean up command line usage help (#3395)
Due to some very old mistakes too many of Delve's flags are declared as
persistent on cobra's root command. For example the headless flag is a
global flag but does not apply to connect, dap or trace; the backend
flag does not apply to replay, core and dap; etc.

Almost all global flags should have been declared as local flags on
individual subcommands. Unfortunately we can not change this without
breaking backwards compatibility, for example:

   dlv --headless debug

would not parse if headless was a flag of debug instead of a global
flag.

Instead we alter usage function and the markdown generation script to
strategically hide the flags that don't apply.

Fixes #2361
2023-08-09 10:37:55 -07:00
Álex Sáez
71f1220717
*: add ppc64le support (#2963)
* Add vendor/golang.org/x/arch/ppc64

* Add ppc64le support
2023-07-07 09:30:38 -07:00
Alessandro Arzilli
7d8f47674b
terminal/starbind: add online help for starlark (#3388)
Adds a new starlark builtin 'help' that prints the list of available
builtins when called without arguments and help for the specified
builtin when passed an argument.

The help is autogenerated from godoc comments so it isn't always
exactly accurate for starlark (in particular we sometimes refer to the
In structs), but it's better than nothing.
2023-06-12 14:31:31 -07:00
Oleksandr Redko
9d6bce467c
_scripts: fix typos (#3402) 2023-05-31 16:33:23 +02:00
Alessandro Arzilli
674bd63996
proc: fix runtime type handling for Go 1.21 (#3370)
Go 1.21 renamed runtime._type to internal/abi.Type and changed the name
of its fields. Update Delve so that it uses the new names for loading
interfaces and generic type parameters.
2023-05-15 10:21:52 -07:00
Oleksandr Redko
d71b3aa6a7
dwarf/op: change generated comment header (#3288)
Change generated comment header for opcodes.go to match Go regexp:
```
^// Code generated .* DO NOT EDIT\.$
```

Fix panic in gen-opcodes.go if no args provided.
2023-02-25 14:12:12 +01:00
Quim Muntal
3d6730d12e
Default to stop test_windows.ps1 when there is an error (#3285)
* default to stop test_windows.ps1 when there is an error

* fix script
2023-02-22 09:25:29 -08:00
Alessandro Arzilli
bc5c0d4a9b
_scripts: Update staticcheck (#3270) 2023-02-14 09:36:00 -08:00
Oleksandr Redko
011fe673fe
_scripts: fix log.Printf format specifier (#3260) 2023-01-31 14:30:04 +01:00
Alessandro Arzilli
709da9a217
Documentation: document how to debug runtime with Delve (#3234)
Add FAQ entry to document how to debug the Go runtime using Delve.
Also add table of contents to FAQ.
2023-01-03 09:23:26 -08:00
Alessandro Arzilli
32df4071d2
TeamCity: fix windows/amd64 builds (#3223)
Windows/amd64 builds are not runnning because the current settings.kts
has an implicity requirement to property teamcity.build.systemDir which
does not exist on windows/amd64 agents.
2022-12-19 08:15:00 -08:00
Alessandro Arzilli
a35b902ecf
gdbserial: continue if tcsetpgrp fails (#3211)
Do not stop if tcsetpgrp errors, also only do it if the target process
got its own process group.

Fixes #3210
2022-12-12 08:36:48 -08:00
Quim Muntal
e5006c105c
Test windows/arm64 pipeline (#3200)
* Test windows/arm64 pipeline

* update build script to support windows/arm64

* skip TestLaunchRequestWithRelativeExecPath is symblink can't be created

* partially fix and skip TestCgoStacktrace

* update backend health docs

* update

* log test output

* skip starbind test on windows arm64

* skip starbind test on windows arm64

* skip rtype test on windows arm64

* skip pie backend tests on windows/arm64

* fix tests

* skip function calls test on windows/arm64

* fix tests

* revert hardware breakpoint test relax

* add pie test clarification

* skip symlink test only on windows

* skip TestStepConcurrentDirect

* readd exp.winarm64

* fix param

* add exp.winarm64 tags

* skip TestGeneratedDoc on winarm64
2022-12-05 15:21:52 -08:00
Quim Muntal
a185d0eac1
Run CI tests on windows/arm64 agents (#3198) 2022-11-17 13:52:38 +01:00
Alessandro Arzilli
4372ce0d27
proc,_scripts/rtype.go: add rtype annotations for g.atomicstatus (#3143)
Adds some rtype annotations for g.atomicstatus and update
_scripts/rtype.go to handle types outside of the runtime package.
2022-09-26 10:10:51 -07:00
Quim Muntal
4455d6a9ef
Add support for windows/arm64 (#3063)
* Add support for windows/arm64

* split sentinel files and add winarm64 experiment

* update loadBinaryInfoPE to support PIE binaries

* skip TestDump on windows/arm64

* run windows/arm64 compilation on windows/amd64

* add entry point check for pie binaries

* delete unusded code

* document windows/arm64 breakpoint

* implement changing windows/arm64 fp registers

* update crosscall offset names

* fix G load when using CGO

* fix testvariablescgo

* remove DerefGStructOffset

* derefrence gstructoffset in GStructOffset() if necessary
2022-09-21 13:39:44 -07:00
cui
5ebf020be9
proc: fix hang caused by g.atomicstatus has change to atomic.Uint32 (#3129)
Co-authored-by: weixiecui <weixiecui@futunn.com>
2022-09-20 11:54:56 -07:00
Alessandro Arzilli
5b9f65dac2
*: switch to int64 for goroutine IDs (#3110)
Go 1.20 switched to uint64 to represent goroutine IDs, we can't
actually follow suit because we have allowed clients to use -1 to refer
to the currently selected goroutine, however we should at least switch
to int64 and also update the rtype check to accept the 1.20 type.
2022-08-16 09:31:11 -07:00
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
6aa54c5c9f
_scripts: un-pin mingw version (#3046)
The version of mingw was pinned to 10.2.0 because mingw 11 started
using DWARFv5, which wasn't supported by Go 1.17. We are now testing
only 1.18 and 1.19 and both support DWARFv5 correctly.
2022-07-11 14:48:51 -07:00
Alessandro Arzilli
c412dcdc4f
*: run go1.19 'go fmt' on everything and fix problems (#3031)
Go 1.19 also formats doc comments according to the new godoc syntax.
Some of our comments, especially unexported symbols did not conform to
the godoc syntax and therefore are mangled by 'go fmt'.

This PR runs 'go fmt' from go1.19 on everything and manually fixes the
problems.

See also:
	https://github.com/golang/proposal/blob/master/design/51082-godocfmt.md
2022-06-17 10:08:11 -07:00
Alessandro Arzilli
5b88e45ca9
proc/native: fix Windows build (#3023)
Commit b53fcbe broke the build on Windows, we didn't notice because 2d9a9d broke the test script.
2022-05-31 16:03:57 -07: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
bfb7181e8d
_scripts: always return exit code 0 when testing on tip (#2980)
So that we can mute failing tests in TeamCity.
2022-04-27 09:10:23 -07:00
Alessandro Arzilli
75b4421d70
_scripts/make: do not exit if git SHA ID can not be retrieved (#2973)
Something changed in TeamCity's infrastructure that makes 'git
rev-parse HEAD' fail systematically on most configurations.
Since the SHA ID isn't necessary anyway, print an error and continue.
2022-04-18 10:47:44 -07:00
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