Commit Graph

2484 Commits

Author SHA1 Message Date
Alessandro Arzilli
34104fb65d
proc,ebpf: mark as unreadable args with unsupported types with ebpf (#3444)
Only a few types can be read with ebpf, mark everything else as
unreadable so that there are no downstream crashes.

Fixes #3443
2023-07-25 16:27:37 -07:00
Alessandro Arzilli
a53f1bf45d
service/api: in multiline mode print address of pointers (#3448)
When printing a pointer variable first print the address that it points
to before printing its dereferenced value.

Fixes #3446
2023-07-25 16:27:00 -07:00
Alessandro Arzilli
ca611db449
terminal: restore breakpoints set with line offset on restart (#3425)
Change FindLocation so it can return a substitute location expression
and propagate it to pkg/terminal/command.
When breakpoints are set using the syntax :<lineno> or +<lineno>
produce a substitute location expression that doesn't depend on having
a valid scope and can be used to restore the breakpoint.

Fixes #3423
2023-07-20 12:29:59 +02:00
gocurr
8023fa956e
all: use "len == 0" rather than "len <= 0" when checking empty slice/string (#3439) 2023-07-13 11:30:32 -07:00
Oleksandr Redko
0e3cae9dc9
service/dap: fix typos in comments (#3438) 2023-07-11 16:10:41 +02:00
gocurr
cbc45e1670
pkg/proc: simplify code with trivial changes (#3436) 2023-07-09 08:27:05 +02:00
Derek Parker
326c451b44
*: add linux/ppc64le targets (#3435) 2023-07-07 21:06:09 +02:00
Alessandro Arzilli
db0bc26949
terminal,service: better printing of suspended breakpoints (#3415)
Show the location expression that will be used to set a suspended
breakpoint in the breakpoints list.

Also change 'target' called without arguments to print a better error
message and 'target follow-exec' without the last argument to print the
state of follow-exec.
2023-07-07 10:33:40 -07:00
Alessandro Arzilli
c1482ca911
proc: check recursion level when loading pointers (#3431)
Fixes #3429
2023-07-07 10:32:05 -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
Suzy Mueller
9f3e146129
service/dap: fix test for debug in progress (#3407)
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.
2023-07-07 08:17:39 +02:00
gocurr
80840dd2bf
all: fix typos (#3434) 2023-07-06 11:16:06 +02:00
Oleksandr Redko
2d3fd35e04
pkg,service: refactor to use %q instead of "%s" (#3430) 2023-07-05 08:49:08 -07:00
gocurr
f016055457
pkg/dwarf/frame: fix FrameDescriptionEntries's Append (#3433)
The current implementation has a bug to remove duplicates.
It can be implemented by using fast-slow pointers.
2023-07-05 08:48:33 -07:00
ttoad
53998cbb18
pkg/proc,service/*: Supports sending output to clients when running programs remotely (#3253)
* wip: Support sending output when remote debug

* wip: Support local output and remote output

* wip: fix stderr and stdout assignment error

* wip: optimize code

* wip: Only if outputMode is "remote" is the redirected console output

* wip: Redirected debugMode output(Not tested on windows)

* wip: support remote debugging output redirection of windows

* wip: real-time write back output

* wip: support for windows

* wip: fix windows remote debug not output

* wip: fix truncated output redirection

* wip: delete printfln

* wip: use debugger.Config to pass redirect(macOS)

* wip: use debugger.Config to pass redirect(linux)

* wip: Change redirect to a concrete type

* wip: s.wg.wait before sending "terminated"

* wip: add proc/redirect test(darwin and linux)

* Merge branch 'master' of github.com:tttoad/delve into feat-console

* wip: Fix test failure on windows

* fix: undefined: proc.Redirects

* fix: compile failure

* wip: Remove useless code

* fix: filename error

* fix: os.file not close

* test: add server_test.redirect

* fix: Remove 'eol' from end of file

* fix: gdbserial: File not closed in file mode.
(in reality, gdbserial will never use file mode)

* feat: Remove "only-remote". Fix spelling mistakes.

* fix: spelling mistakes

* refactor: redirect

* fix: stdout and stderr are not set to default values

* fix: Restore code logic for rr.openRedirects()

* fix: Optimization Code

* fix: utiltest

* fix: execpt out

* fix: Resource release for redirects

* fix: build failure

* fix: clean->clear

* fix: build failure

* fix: test failure

* fix: Optimization Code

* style: remove useless code

* refactor: namedpipe

* refactor: namedpipe, launch ...

* fix: freebsd compile failure

* fix: proc_darwin compile failure

* style:  remove useless code

* feat: add d.config.Stdxx check on debug.Restart

* style: formatting and adding comments

* style: formatting and adding comments

* feat: add d.config.Stdxx check on debug.Restart

* style: namedpipe->redirector

* style: namedPipe->redirector

---------

Co-authored-by: 李翔 <qian.fu2@amh-group.com>
2023-07-05 08:39:01 -07:00
Alessandro Arzilli
d963eb1057
proc: read context from sigtrampgo, fixes TestCgoStacktrace2 on 1.21 (#3401)
* logflags,proc: flag to log stacktrace execution

Add a log flag to write logs about what the stacktracer does.

* proc: read context from sigtrampgo, fixes TestCgoStacktrace2 on 1.21

Changes stacktrace code to read the signal context from the arguments
of sigtrampgo.
Also changes the automatic fatalthrow breakpoint for go 1.21.
In combination these two changes fix TestCgoStacktrace2 on Go 1.21 on
various platforms.
2023-06-27 09:33:07 -07:00
Alessandro Arzilli
1647fa6b5e
all: Bump to v1.21.0 (#3428)
Thank you @alexandear, @chenhengqi, @cuishuang, @alexsaezm, @suzmue,
@spacewander, @ZekeLu, @fche, @andreimatei, @nozzy123nozzy
2023-06-27 09:04:52 -07:00
Alessandro Arzilli
afef1aec60
proc: skip TestDebugStripped on linux/386/pie (#3427)
PIEs do not have a .data.rel.ro.gopclntab section on linux/386. Disable
the test.
2023-06-20 09:55:30 -07:00
Oleksandr Redko
322a138cf2
service/dap: fix typos in comments (#3426) 2023-06-20 14:53:18 +02:00
Derek Parker
656c4f13df
pkg/proc: improve stripped binary support with PIE (#3421)
Take into account static base for PIE binaries.
2023-06-16 09:38:19 +02:00
Alessandro Arzilli
14d9c1881d
proc: only print warning when gopclntab can not be read for first image (#3420)
Only print the warning that gopclntab can not be read for the first
image (i.e. the executable file), also change the returned when neither
DWARF nor gopclntab are found to preserve the DWARF error.
2023-06-15 08:28:35 -07:00
Alessandro Arzilli
95dac8f19b
service,terminal: when libraries don't have debug_info print reason (#3419)
Print the reason why libraries don't have debug info in response to the
'libraries' command.
2023-06-15 08:00:59 -07:00
Derek Parker
d006538bb6
pkg/terminal: regenerate starlark mappings (#3418) 2023-06-15 12:09:20 +02:00
Derek Parker
1d28ceccdc
pkg/proc: fix ebpf probe tracing backen uprobe handling (#3417)
Uprobes get automatically cleaned and removed when the reference to
the Link object is lost. Hold a reference to any active Uprobe Link
for duration of Delve execution and ensure they are cleaned up
at exit.

Fixes ebpf probes don't work after time.Sleep() #3227
2023-06-15 12:07:32 +02:00
Derek Parker
ccf17a6f42
pkg/proc: enable basic debug functionality for stripped ELF binaries (#3408)
We used to parse the .gopclntab section but removed support in favor of
simply using DWARF debug information, due to lack of C symbols among
other reasons. This makes it impossible to debug stripped binaries,
which some distrubutions ship by default.

Add back in basic support for .gopclntab which survives if the binary
is stripped, allowing for rudimentary debugging such as basic
program navigation, tracing, etc...
2023-06-14 13:23:46 +02: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
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