Commit Graph

2719 Commits

Author SHA1 Message Date
Oleksandr Redko
50518504e1
Documentation: using go install is preferable (#3853) 2024-11-06 10:27:10 -08:00
Oleksandr Redko
6b2ed0d684
proc: fix typos in errors and comments (#3852) 2024-11-06 15:15:48 +01:00
Oleksandr Redko
844712a30b
proc: run gofmt (#3851) 2024-11-06 15:15:14 +01:00
Alessandro Arzilli
e9616a7f98
proc: fix rangeFuncStackTrace with inlined functions (#3849)
If an inlined function is encountered we should keep searching for its
rangeParent even if we don't have a closurePtr because it could be that
the function has been inlined into its rangeParent.

This does not need a new test, the existing tests already fail on
go1.24.
2024-11-04 08:21:40 -08:00
Alessandro Arzilli
822014b8e8
service,terminal,cmd/dlv: automatically guessing substitute-path config (#3781)
Add command, API calls and launch.json option to automatically guess
substitute-path configuration.
2024-10-31 10:19:08 -07:00
Michael Pratt
ac14553fda
service/rpc2: correct ExamineMemory length error message (#3846)
The maximum length changed in 52405ba86bd9e14a2e643db391cbdebdcbdb3368.
2024-10-31 16:26:47 +01:00
Hyang-Ah Hana Kim
ac8b4718bd
all: import go telemetry and enable crash reporting (#3841)
Imported golang.org/x/telemetry@9c0d19e to avoid
go version requirement change.

For #3815
For golang/go#70056
2024-10-29 12:12:42 -07:00
Alessandro Arzilli
1748f5f3d1
TeamCity: move riscv64 backend testing to tip (#3842)
Updates #3832
2024-10-28 11:38:01 -07:00
Alessandro Arzilli
2a9af735d0
_scripts: update staticcheck version (#3839)
Update version of staticcheck and reenable for go1.23
2024-10-23 12:40:35 -07:00
Chen
bef326c6a5
proc: use CPUID to determine ZMM_Hi256 region offset (#3831)
The offset of state component i can be found via
CPUID.(EAX=0DH,ECX=i):EBX. The ZMM_Hi256 is state component 6, so we use
CPUID to enumerate the offset instead of hardcoding.

For core dumps, we guess the ZMM_Hi256 offset based on xcr0 and the
length of xsave region. The logic comes from binutils-gdb.

Fixes #3827.
2024-10-21 09:16:57 -07:00
Alessandro Arzilli
423644e288
Documentation: fix autogenerated markdown documentation (#3836)
Changes < to &lt; in autogenerated documentation for CLI commands so that markdown does not interpret them as HTML tags.

Supersedes #3830
Fixes #3829
2024-10-21 09:15:44 -07:00
Alessandro Arzilli
1a9bd03d7a
goversion: parse version for development builds (#3837)
Once upon a time Go version strings for development builds did not
reference the major/minor version they belonged to, therefore the best
we could do was to always assume that a development build belonged to
the most recently released version of Go.

This commit changes pkg/goversion so that the new style of development
version string is fully parsed.
2024-10-21 09:15:02 -07:00
Alessandro Arzilli
064ef226ca
pkg/proc/core: Clean up some repetitive code (#3834)
Cleans up repetitive code in pkg/proc/core and also adds coredumpctl
support to our test suite.
2024-10-21 09:12:34 -07:00
Alessandro Arzilli
05dc760877
*: mark riscv64 port as experimental (#3835)
Delete non-working prologue detection code and mark port as experimental.

Updates #3832
2024-10-14 11:04:03 -07:00
lrzlin
75c41f2b64
delve: add linux-riscv64 support (#3785) 2024-10-11 12:34:25 -07:00
yelvens
abc948b0ae
all: update golang.org/x/arch to v0.11.0 (#3826)
added loong64 support for gnu format disassembler and plan9 format disassembler in golang.org/x/arch

$ go get -u golang.org/x/arch@v0.11.0
$ go mod tidy
$ go mod vendor

Co-authored-by: Huang Qiqi <huangqiqi@loongson.cn>
2024-10-09 08:10:11 -07:00
Alessandro Arzilli
025d47c6e9
proc: adds pointer pinning to call injection (#3787)
This commit adds a new mode to call injection. If the runtime.debugPinner
function is available in the target executable it obtains a pinner by
calling it and then uses it to pin the pointers in the results of call
injection.

This allows the code for call injection to be refactored to execute the
calls in the normal order, since it doesn't need to be concerned with having
space on the target's memory to store intermediate values.

Updates #3310
2024-10-04 10:44:57 -07:00
Alessandro Arzilli
52405ba86b
terminal,service: add raw examinemem dump (#3721)
Change the examinemem command to have a new format 'raw' that just
prints the raw memory bytes.
Change the transcript command to add a new flag that disables prompt
echo to the output file.

Fixes #3706
2024-10-03 14:09:38 -07:00
Alessandro Arzilli
4a5350fd1f
tests: disable TestGeneratedDoc on 1.24 (tip) (#3820)
The test is currently broken due to a change to the export format.
2024-10-01 11:00:52 -07:00
Alessandro Arzilli
a3d7712752
*: replace uses of uniq with slices.Compact (#3821) 2024-10-01 10:16:49 -07:00
Oleksandr Redko
8c645a32d7
pkg/proc: simplify tests by using errors.As (#3818) 2024-10-01 08:54:11 -07:00
Nilesh Singh
8b878fb238
cmds/commands: Update 'client-addr' to support Unix domain sockets (#3819)
* cmds/commands: Update 'client-addr' to support Unix domain sockets

This change updates the '--client-addr' flag to accept Unix domain sockets (UDS). Currently, the --listen flag supports UDS, but --client-addr does not. This modification ensures consistency across the APIs and improves support for vscode-go, which uses reverse mode (via client-addr) to connect to DAP.

Fixes #3814

* Undo formatter changes in dlv_test.go

* Update commands.go
2024-09-30 11:20:48 -07:00
Jorge Gomez
ed40291572
Documentation: Add dape to list of plugins (#3817) 2024-09-26 09:02:14 +02:00
Alessandro Arzilli
def0688e7a
proc: step into coroutine (#3791)
The step command is changed such that when the function being currently
called is a coroutine switch function it will move to the associated
coroutine.
Functions that switch coroutines are currently the next, stop and yield
closures produced by the iter.Pull function.
2024-09-24 10:22:04 -07:00
Alessandro Arzilli
856ad78be0
*: release version 1.23.1 (#3816)
Thanks to @Jille, @linchizhen and @arvidfm.
2024-09-23 11:37:44 -07:00
Alessandro Arzilli
059f149433
proc: cache module data (#3800)
Cache module data so that we don't reload it every time we look up a
variable with a generic type.
2024-09-18 14:17:07 -07:00
Alessandro Arzilli
582305a813
proc: for optimized functions allow .closureptr to not exist (#3808)
* proc: flag variables correctly when range-over-func stmts are used

Argument variables of a range-over-func body closure should be returned
flagged as normal local variables, not as function arguments.

Updates #3806

* proc: for optimized functions allow .closureptr to not exist

For optimized functions .closureptr is sometimes omitted from DWARF,
allow it to be 0 and try to recover the range-over-func stack by best
effort.

Fixes #3806
2024-09-18 14:16:34 -07:00
Alessandro Arzilli
b9fadbae9b
proc: improve Rosetta check (#3810)
We have a check for Rosetta that should point users towards
misconfiguration, however occasionally we still get new issues about
debugserver crashing and some of those, as it turns out, are still
caused by Rosetta (see for example #3804).

Check the output of 'uname -m' and check that it isn't 'x86_64' if we
are an 'arm64' process: if that happens we are running unemulated but
debugserver will refuse to work.
2024-09-18 09:03:41 -07:00
Alessandro Arzilli
a63cc8a1a3
proc: fix result type of division of untyped constants (#3794)
The Go specification says that the result of division of untyped
constants should be an untyped integer constant if both constants are
untyped integers, the go/constant package however does something
different by always producing an untyped floating constant.

Fixes #3793
2024-09-05 09:23:21 +02:00
Alessandro Arzilli
c2dc6edcfc
service/dap: fix test failure with 1.24 (#3805)
Encoding/json changed some error messages in 1.24, fix the tests.
2024-09-04 07:34:51 -07:00
Alessandro Arzilli
7857f233ad
service/dap: make handlesMap generic (#3798)
The oldest version of Go we compile with is 1.20 at this point, we can
thus make use of generic type parameters and the handlesMap support
type in service/dap is improved by them.
2024-09-03 10:40:34 -07:00
Alessandro Arzilli
162959baee
proc: workaround for macOS section name truncation (#3799)
Go 1.23 and earlier does not take into account that Mach-O section
names are limited to 16 characters, which causes DWARF sections with
long names to be truncated and become unreadable.

Fixes #3797
2024-09-03 10:39:27 -07:00
Arvid Fahlström Myrman
2abf517c21
terminal/starbind: fix starlark conversion of named consts (#3802)
* terminal/starbind: fix starlark conversion of named consts

If a value of a derived integer type matches a named constant,
Delve will wrap the string representation of the value with
the name of the constant, causing ParseInt/ParseUint to fail.
This change removes the wrapping before attempting to parse
the value before sending it to Starlark.

* terminal: add starlark tests for enums
2024-09-03 10:36:42 -07:00
linchizhen
0ebca87b6d
chore: fix function name (#3803)
Signed-off-by: linchizhen <jiayanbing@yeah.net>
2024-08-31 13:52:05 +02:00
Jille Timmermans
a164b89df1
eval: Allow reslicing a slice up to its cap, rather than its length (#3796)
fix a couple of places where we needed to track the cap
2024-08-28 11:41:23 -07:00
Alessandro Arzilli
a6849f2c7a
proc: fix TestRangeOverFuncNext on linux/386 (#3795)
TestRangeOverFuncNext and TestRangeOverFuncNextInlined are failing on
linux/386 with go1.23 due to an inconsistency on how append works on
32bit platforms.
2024-08-26 22:13:29 -07:00
Alessandro Arzilli
f2571fd46e
proc: fix step stuttering when entering range-over-func bodies (#3788)
Fixes a repeated stop on the first line of a range-over-func body when
stepping through a program. The entry point breakpoint is changed to a
special breakpoint that, when hit:

- clears the current temporary breakpoints
- sets breakpoints like 'next' would, and
- resumes execution.
2024-08-10 21:15:26 -07:00
Alessandro Arzilli
64f3d34663
proc: move stepping test to their own file (#3784)
Move all tests of the functionality of proc.next,
proc.(*TargetGroup).Next, proc.(*TargetGroup).Step,
proc.(*TargetGroup).StepOut to their own test file.
2024-07-19 21:29:56 -07:00
Alessandro Arzilli
56e9b85f40
*: release version 1.23.0 (#3782)
Thanks to @alexandear, @scop, @howardjohn, @archanaravindar, @abbasudo,
@fatanugraha, @jayantxie and @zdyj3170101136.
2024-07-16 11:44:48 -07:00
Alessandro Arzilli
3ff6dc5d0d
teamcity: fix typo in configuration (#3783) 2024-07-16 11:43:16 -07:00
Alessandro Arzilli
eb0c6f89e2
goversion: add 1.23 to supported versions, update test matrix (#3780)
Add 1.23 to supported versions and to test matrix, remove 1.19 and 1.20
from supported versions (1.19 should have been removed long ago, but we
forgot to do it on release).
2024-07-15 14:43:03 -07:00
Alessandro Arzilli
c1366e90cc
proc: fix bug with range-over-func stepping (#3778)
Set a breakpoint on the return address of the current function, if it's
a range-over-func body, and clear the stepping breakpoints for the
current function (except the entry one) when its hit.

Without this what can happen is the following:

1. the range-over-func body finishes and returns to the iterator
2. the iterator calls back into the range-over-func body
3. a stepping breakpoint that's inside the prologue gets hit

Updates #3733
2024-07-14 21:27:47 -07:00
Oleksandr Redko
3ae22627df
*: replace old golang.org links with new go.dev (#3774) 2024-07-12 12:12:44 -07:00
Oleksandr Redko
c1c9feae3e
service/rpc1: add Go Reference doc (#3779) 2024-07-12 12:10:25 -07:00
Alessandro Arzilli
abad6bb97e
proc: use .closureptr for stepping through range-over-func statements (#3763)
* proc: use .closureptr for stepping through range-over-func statements

Uses special variables .closureptr and #yieldN to correctly identify
the parent frame of a range-over-func body closure call.

Updates #3733

* fix
2024-07-11 10:26:38 -07:00
Oleksandr Redko
b791f91c0e
pkg/dwarf/line: use t.Logf instead of fmt.Printf in tests (#3772) 2024-07-11 10:19:09 -07:00
Oleksandr Redko
ef13067401
pkg: refactor to buf.WriteString() (#3769) 2024-07-11 08:06:51 -07:00
Oleksandr Redko
a3e4a41468
pkg/terminal: add missing file.Close() call (#3770) 2024-07-11 08:06:16 -07:00
Alessandro Arzilli
a151be7eca
go.mod: update gopkg.in/yaml to v3 (#3776)
We are already importing v3 indirectly for github.com/spf13/cobra/doc,
update our own dependency to v3 as well so that we can delete one
module from the vendor directory.
2024-07-11 08:04:47 -07:00
Oleksandr Redko
d8003a74c8
pkg/proc: fix 404 links and change to https (#3775) 2024-07-11 08:03:32 -07:00