* 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.
Add a waitfor option for 'dap attach' that waits for a process with a
given name to appear before attaching to it.
This recovers PR #3584, originally by @muggle-nil, which was fine
except for a broken test.
_fixtures/fncall.go was made to support TestCallFunction in pkg/proc
and new things must be added to fncall.go to test new features. Having
a test depend on precise line numbers makes the process tedious.
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
* Add pprofLabelForThreadNames config
The config is a string value that indicates the key of a pprof label whose value
should be shown as a goroutine name in the threads view.
Go1.22 has changed some line number assignments. The new line number
assignments are still valid however some tests in dap relied on them
being different and broke as a result. This commit fixes those tests
and makes them less brittle.
Also disables TestDebugStripped and TestDebugStripped2 temporarily on
1.22.
* Add ShortenType function
Taken from
https://github.com/aarzilli/gdlv/blob/master/internal/prettyprint/short.go
with kind permission by @aarzilli.
* Shorten type names in variable values
The variables view in VS Code is a lot easier to read if long type names are
shortened in much the same way as we shorten them for functions in the call
stack view.
We only shorten them in the value strings; the Type field of dap.Variable is
kept as is. Since this only appears in a tooltip, it isn't a problem to have the
full type visible there.
- fix TestRefreshCurThreadSelGAfterContinueOnceError and TestBadAccess
to work when debugserver has --unmask-signals
- when a fatal signal is received while singlestepping delay its
delivery until the subsequent continue, otherwise debugserver will get
stuck completely (fixes TestNilPtrDerefInBreakInstr)
This solves the problem that function names with long package paths are hard to
read when the callstack window is narrow, because all you see is the beginning
of the package path.
For example, instead of
github.com/some/long/package/path/pkg.(*SomeType).SomeMethod
we now display
pkg.(*SomeType).SomeMethod
The regular expression attempted to match for a network address,
but actually does not match any network addresses. The two
documentation includes "192.0.2.1:25" and "[2001:db8::1]:80" as
examples, neither of which match the current regex. This change
updates the regular expression to ensure that there is some text
at the desired position, but not what the text is.
A series of interconnected changes to both the terminal command
'config', DAP command 'dlv config', quality of life improvements to how
substitute-path works, and better documentation.
- Let 'config substitute-path' show the current substitute path rules
- Add a -clear command to 'config substitute-path'
- Support 'config-debug-info-directories'
- rewrite SubstitutePath to be platform independent (see below)
- document path substitution more
Regarding the rewrite of SubstitutePath: the previous version used
runtime.GOOS and filepath.IsAbs to determine which filepath separator to use
and if matching should be case insensitive. This is wrong in all situations
where the client and server run on different OSes, when examining core files
and when cross-compilation is involved.
The new version of SubstitutePath checks the rules and the input path to
determine if Windows is involved in the process, if it looks like it is it
switches to case-insensitive matching. It uses a lax version of
filepath.IsAbs to determine if a path is absolute and tries to avoid having
to select a path separator as much as possible
Fixes#2891, #2890, #2889, #3179, #3332, #3343
- use PT_SUSPEND/PT_RESUME to control running threads in
resume/stop/singleStep
- change manual stop signal from SIGTRAP to SIGSTOP to make manual stop
handling simpler
- change (*nativeProcess).trapWaitInternal to suspend newly created
threads when we are stepping a thread
- change (*nativeProcess).trapWaitInternal to handle some unhandled
stop events
- remove misleading (*nativeProcess).waitFast which does not do
anything different from the normal wait variant
- rewrite (*nativeProcess).stop to only set breakpoints for threads of
which we have received SIGTRAP
- rewrite (*nativeThread).singleStep to actually execute a single
instruction and to properly route signals
* 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
service/dap: fix indexing bug for maps
There was a bug that cut off the second half of a map, because the
number of variables was not accurately reported to the client.
Fixesgolang/vscode-go#2351
Due to dyanmically loaded libraries there could be aribitrarily large
gaps in the address space, between functions. Limit the memory size we
are willing to disassemble.
Fixes#3040
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
1. change ExpectOutputEventProcessExited to accept -1 exit status, this
is a real problem on linux but we don't know how to fix it and we
already have a test in proc for it.
2. change TestNoDebug_AcceptNoRequestButDisconnect to be less picky
about message ordering, all message orderings seem to be fine, there
is no reason to insist on a particular one, since the DAP server is
unable to actually produce it deterministically.
Fixes#2860
* dap: support 'Env' attribute for launch requests
Env is applied in addition to the delve process environment
variables. The env setting is done by calling os.Setenv
as early as possible when a Launch request is received.
Prior discussion is in https://github.com/go-delve/delve/pull/2582
In Visual Studio Code, setting null for an environment variable
in launch.json or tasks.json indicates users want to unset
the environment variable. Support the behavior by accepting
nil value.
* dap: Env field itself can be omitempty
* edit comment
* 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.