The rangeParent calculation was changed 0b74953f0 to address slowness
(due to repeated calculations) when calling PackageVariables. That
changed caused to program to use a lot of memory due to having to
calculate the range bodies of every function. This change reverts
0b74953f0 and splits off rangeBodies calculation from the extras method
of Function, so that it isn't called from PackageVariables.
Fixes#4146
Adds an RPC call to cancel in-progress debuginfod-find downloads. Wires
this call to ^C in the terminal interface and to receiving a Pause
request while already pausing in DAP.
Adds a new terminal command to download the debug info for libraries
for which it hasn't been downloaded already.
Fixes#3906
Add a GetEvents method that can be used to retrieve debug events, adds
events for downloading debug info through debuginfod and shows those
events in the command line client as well as console messages in DAP.
In the future this events mechanism can be used to unify EBPF
tracepoints with old style tracepoints.
Update #3906
This flag in internal/abi.Type is moving from the Kind_ field to
the TFlag field. See https://go-review.googlesource.com/c/go/+/681936
A few of the other Kind fields dlv doesn't use (and don't exist
in Go anymore), so this code can be simplified somewhat.
When using cgo some of the compilation units are produced by the C
compiler and could be in DWARFv5 even if most of the executable is
DWARFv4. In those cases debugging will still work fine outside of C
areas of the executable, it's probably better to proceed.
* service/test: fix compile error in tests
Due to a merge conflict the tests in service/test are not compiling.
* proc: add support for struct literals
Adds support for evaluating struct literals, and allocating them into
the target's memory.
Updates #1465
* deduplicates exprToString, defined in multiple packages, and moves it
to astutil
* moves resolveTypedef into pkg/dwarf/godwarf, this is currently only
used by pkg/proc but we will need to call it from pkg/proc/evalop
* creates a new FakePointerType function in pkg/dwarf/godwarf, this is
also a function that is only used by pkg/proc but pkg/proc/evalop will
also need.
Updates #1465
* delve: support linux-loong64 native debug
LoongArch is a new RISC ISA, which is independently designed by Loongson Technology.
LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S)
and a 64-bit version (LA64), and loong64 is the 64-bit version of LoongArch.
LoongArch documentation: https://github.com/loongson/LoongArch-Documentation.git
* *: mark loong64 port as experimental
---------
Co-authored-by: Huang Qiqi <huangqiqi@loongson.cn>
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.
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
* 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
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
Fixes bug where the incorrect Build ID could be used to try and download the source for a binary. This is because the Build ID was stored on the BinInfo object for a target and not the image itself.
Initial support for stepping in functions that use the new
range-over-func statement in go1.23.
Does not support:
- inlining
- viewing variables of the enclosing function from a range-over-func
body closure
- the correct way to find the enclosing function from a range-over-func
body closure (but it should work most of the time).
Updates #3733
It seems newer MacOS kernels are sending mach exceptions for watchpoints
which contain the hardware register number as opposed to the address
which triggered the exception. Also, ARM64 seems to have switched to
sending _EXC_I386_SGL as medata[0] for this exception type.
Adds a recover to the functions reading debug info from the go runtime
data structures for stripped executables.
This function is best-effort and can sometimes fail in weird ways,
instead of crashing recover any panic and turn them into errors.
Fixes#3650
This allows us to update this dependency on our schedule which is important because the module relies on manually updating the known list of Go versions to function correctly. Forking allows us to keep this up to date ourselves and possibly create a new system to prevent having to perform this manual step in the future.
This patch switches from using a forked version of one of the libraries
of goretk/gore to using the module directly. This is possible now that
certain functionality has been exposed / fixed within that module making
it usable for Delve.
Instead of having a different version for each architecture have a
single version that uses an architecture specific list of registers.
Also generalize it so that, if we want, we can extend the workaround to
other runtime functions we might want to call (for example the channel
send/receive functions).
This patch adds support for listing and setting breakpoints on inlined functions within stripped binaries. It uses a forked version of `debug/gosym` copied from golang.org/x/vuln/internal/vulncheck/internal/gosym which adds support for parsing the inline tree of the pclntab section. Parsing this section requires knowing the offset of the "go:func.*" symbol, which is not present in stripped binaries via the ``.symtab` section so instead, we search the `.noptrdata` section which contains `runtime.moduledatap` which contains the value of that missing symbol, which we then can use to find the inline tree for a given function.
Given all this we parse the inline tree for each function we find, and then add that information the the appropriate `Function` contained in `bi.Functions`, using a relatively empty `Function` struct as what would be the abstract origin.
Go1.22 switched to emitting PIE by default and also changed some
details of the PIE implementation. This breaks delve entirely on macOS.
Fix how relocations are handled on macOS.