Commit Graph

2458 Commits

Author SHA1 Message Date
Suzy Mueller
e549a02f0e
service/dap: update go-dap to latest (#3414)
* service/dap: update go-dap to latest

* update remaining possible nil checks

* move helper functions to the end of the file
2023-06-12 14:29:44 -07:00
Alessandro Arzilli
380920c340
TeamCity: fix linux/arm64 build (second attempt) (#3411)
Second attempt at doing what PR #3403 tried to do.
2023-06-12 14:29:09 -07:00
Alessandro Arzilli
c958128f21
terminal: expand ~ in paths passed to 'source' (#3387) 2023-06-06 20:52:19 -07:00
Alessandro Arzilli
5880f4cec9
proc/test: reenable cgo testing on FreeBSD (#3394) 2023-06-06 20:50:03 -07:00
Alessandro Arzilli
9b17415e83
terminal: ask for confirmation when using 'quit -c' with breakpoints (#3398) 2023-06-06 20:46:56 -07:00
Alessandro Arzilli
ea13a24f38
TeamCity: fix linux/arm64 build (#3403) 2023-06-06 20:46:00 -07:00
Andrei Matei
6d412c65da
rpc2, debugger: Fix comments around goroutine grouping (#3374) 2023-06-06 20:44:51 -07:00
nozzy123nozzy
8b9c3a93f5
cmd/commands: Fix to read debug info file from the correct directory when using trace command with -e option. (#3405) 2023-06-06 16:12:11 -07:00
Andrei Matei
7603e46f75
starbind: fix use of ptr variables in starlark (#3386) 2023-05-31 10:29:36 -07:00
Alessandro Arzilli
407ace96c8
debugger: inline clearBreakpoint, createLogicalBreakpoint (#3389) 2023-05-31 10:21:12 -07:00
Alessandro Arzilli
cc05aa2064
TeamCity: actually run linux/386 tests on linux/386 (#3392) 2023-05-31 10:18:15 -07:00
Alessandro Arzilli
6d7263f6f9
service/rpccommon: correct wrong comments (#3397) 2023-05-31 10:11:47 -07:00
Andrei Matei
5c711f8d09
docgen: fix links with trailing dots (#3399) 2023-05-31 10:00:06 -07:00
Andrei Matei
6a56d0eedc
dwarf: ignore DeclLine for function args (#3400) 2023-05-31 09:58:47 -07:00
Oleksandr Redko
9d6bce467c
_scripts: fix typos (#3402) 2023-05-31 16:33:23 +02:00
Alessandro Arzilli
47989248ed
dwarf/op: use readMemory function (#3391)
dwarf/op gained the ability to execute DW_OP_deref opcodes a while ago
but because we didn't save the readMemory function in the context
structure it never worked.
2023-05-26 10:04:37 -07:00
Andrei Matei
c2bfdfc76b
starbind: Make the time module available to star scripts (#3375)
This patch makes the time library available to Starlark scripts. This
library is one of the very few few that are built into starlark-go (the
others are json, math, proto).
I've played around with Starlark scripting today, and immediately I
wanted to measure how long certain computations take.
2023-05-23 11:23:33 -07:00
Andrei Matei
b79dd04070
documentation: add a note about starlark structs (#3376)
It took me a bit to understand how to pass structs to Starlark built-ins. The
documentation didn't really address it - there was an example, but quite
hidden. This patch adds some words about it.
2023-05-23 11:22:41 -07:00
Frank Ch. Eigler
68f58561bb
debuginfod-find stderr may contain diagnostics; look at stdout only for filename (#3381) 2023-05-23 11:11:51 -07:00
Oleksandr Redko
3b251c9dd3
dwarf,proc: fix typos in comments and error messages (#3379) 2023-05-23 18:22:20 +02:00
Oleksandr Redko
e33806a3f7
service: fix typos in comments, logs, tests, and vars (#3378) 2023-05-23 18:21:36 +02:00
Alessandro Arzilli
faebde12f4
proc: remove addrret field from Stackframe struct (#3373)
This field was part of the original stack tracing algorithm, we haven't
used this in years.
2023-05-17 09:10:19 -07:00
Oleksandr Redko
c5d9baaeb6
pkg/proc,pkg/terminal: close response body in tests (#3372) 2023-05-17 12:01:26 +02:00
Alessandro Arzilli
84b757ad57
cmd/dlv,service/dap: use randomized name as default output binary (#3366)
Using a fixed path as the default output binary means that executing
Delve twice in the same directory will cause the second invocation to
overwrite the output binary of the first instance of Delve, making the
restart command not work correctly.

Fixes #3345
2023-05-16 09:36:15 -07:00
Zeke Lu
463b97dd36
pkg/proc: pad variable mem in extractVarInfoFromEntry (#3365)
* pkg/proc: pad variable mem in extractVarInfoFromEntry

On 64 bit system, the byte size of the following struct is 16:
    type myStruct struct {
       a int
       b uint32
    }
But extractVarInfoFromEntry only allocates a mem of 12 bytes for it.
When calling method of this struct with the "call" command, it will
result in this error:
    write out of bounds

This patch extends the mem by adding padding bytes to the end of the
mem.

Fixes #3364.

* move the padding logic into newCompositeMemory
2023-05-15 14:46:33 -07:00
Oleksandr Redko
1c9792bce4
cmd/dlv: logger is not closed in connect command (#3367) 2023-05-15 10:22:33 -07: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
Alessandro Arzilli
e95ae9c21b
proc,terminal: read command line of new processes (#3346)
Read the command line of the main target process as well as any other
process Delve attaches to in follow exec mode.
The command line can be viewed using the 'target list' command.

In follow exec mode this command line is used to match the follow exec
regex to decide whether or not to attach to a child process.

On macOS or when using rr the list of arguments is not available for
attached processes since there is no way to use the gdb serial protocol
to read it.

Fixes #2242
2023-05-09 11:40:00 -07:00
罗泽轩
801a9109c7
trace: add timestamp to the output (#3358)
Fix #3356
2023-05-08 10:41:47 -07:00
Oleksandr Redko
a57c60e43a
service/dap: refactor funcs always returning nil error (#3357) 2023-05-08 10:41:14 -07:00
Alessandro Arzilli
5c7049b7b1
dwarf/godwarf: fix alignment calculation for typedef types (#3362)
Alignment calculation for typedef types was wrong due to a missing
Align method.

Fixes #3360
2023-05-08 10:38:53 -07:00
Eng Zer Jun
8711f6217d
refactor: replace Readdir(-1) with os.ReadDir (#3361)
We can simplify the following code
	dir, err := os.Open(dirname)
	if err != nil {
		return err
	}
	defer dir.Close()

	dirs, err := dir.Readdir(-1)

with just `os.ReadDir(dirname)`.

Reference: https://pkg.go.dev/os#ReadDir

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-05-08 10:37:30 -07:00
罗泽轩
8c9ce617c9
chore: don't ignore directory cmd/dlv (#3359)
Currently, cmd/dlv is ignored, breaks tools which read the gitignore
file. For example, rg can't search files under cmd/dlv.
2023-05-05 09:59:43 -07:00
Oleksandr Redko
a3b053df86
pkg/proc: add missing response body Close in test (#3355) 2023-05-04 13:59:16 +02:00
Derek Parker
f3bfa7c177
pkg/proc: remove memlock limit for ebpf trace backend (#3353)
Fixes #3283
2023-05-03 09:41:32 +02:00
Alessandro Arzilli
13ad7dc1d5
*: misc improvements to config command and substitute-path rules (#3335)
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
2023-05-02 12:23:59 -07:00
Suzy Mueller
9873e0ef63 service/dap: use reloaded value
The only part of the reloaded value that was used was the
Children. This caused a bug where the Time format string was
reloaded, but it was not being displayed.

Fixes go-delve/delve#3342
2023-04-29 09:55:45 +02:00
Oleksandr Redko
5f588d8927 service/dap,service/debugger: refactor regexp funcs
Use regex.MatchString and regex.MustCompile.
2023-04-28 17:23:35 +02:00
Oleksandr Redko
25f0e7712e proc/test: replace old func testName with T.Name
testName is needed only for Go <= 1.7.
2023-04-28 17:22:41 +02:00
Oleksandr Redko
cc71863594
service: fix typos in comments (#3344) 2023-04-27 13:39:33 -07:00
Álex Sáez
bdec83da45 Fix typo 2023-04-25 15:35:06 +02:00
Álex Sáez
5a159c2ef2 Add additional information to how to filter goroutines 2023-04-25 15:35:06 +02:00
cui fliter
e24a7b1174 fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-04-25 11:19:13 +02:00
Alessandro Arzilli
a61ccea65a
service/debugger,terminal: API and user interface for follow exec mode (#3286)
Updates #2551
2023-04-24 14:37:31 -07:00
Alessandro Arzilli
47481fe0ab
proc/native: support core dumping on FreeBSD (#3305)
Co-authored-by: a <a@kra>
2023-04-24 14:33:38 -07:00
Alessandro Arzilli
83a2555497
debugger: do not panic if defer location can not be found (#3329)
convertDefers should not try to dereference nil if the deferred
location does not belong to a function.
2023-04-24 13:38:19 -07:00
Hengqi Chen
64d5ce26d6
proc: Simplify eBPF backend implementation (#3325)
* Remove standard C headers since we have vmlinux.h already
* Simplify get_goroutine_id() implementation, this reduces a map
  and thus reduces runtime memory comsumption.

While at it, unify all indention using 4 spaces.

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
2023-04-24 13:37:58 -07:00
Alessandro Arzilli
36980dcbf9
proc: step breakpoints shouldn't hide normal breakpoints (#3287)
When using Step on a function that has a dynamic CALL instruction we
set a Step breakpoint on the call.
When it is hit we determine the destination of the CALL by looking at
registers, set a breakpoint there and continue.
If the Step breakpoint is hit simultaneously with a normal breakpoint
our Step logic will take precedence and the normal breakpoint hit will
be hidden from the user.

Move the Step logic to a breaklet callback so that it does not
interfere with the decision to stop.
2023-04-24 12:12:54 -07:00
Alessandro Arzilli
70b80623d1
service/dap: fix failing test on Go 1.21 (#3312) 2023-04-24 12:11:50 -07:00
Alessandro Arzilli
6d88b52509
proc: disable flaky tests on windows/arm64 (#3328)
Disable some tests on windows/arm64 that are flaky.
2023-04-24 12:10:50 -07:00