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
* rebasing on master to implement --followcalls
* in progress changes to enable --followcalls
* rebase to master: modified function to add children to funcs array
* modify main traversal loop
* added tests to check different scenarios
* added tests to check different scenarios
* added tests to check different scenarios
* add test to check for overlapping regular expression
* modified type of strings array as a return only
* changed depth to a simple integer instead of a global map
* avoid calling traverse on recursive calls
* Added tests for various call graphs to test trace followfuncs
* Added tests for various call graphs to test trace followfuncs
* Added tests for various call graphs to test trace followfuncs
* made auxillary changes for build to go through for new option follow-calls
* Add support to print depth of the function calls as well
* Added two sample output files for checking
* Bypass morestack_noctxt in output for verification testing
* Corrected newline error by adding newlines only if the line does not match morestack_noctxt
* Added more tests
* Cleanup
* Updated documentation
* fixed error message in fmt.Errorf
* Fixed result of Errorf not used error
* Addressing review comments to fix depth reporting and other issues
* dont invoke stacktrace if tracefollowcalls is enabled, compute depth from main regex root symbol than main.main
* Addressing a part of review comments
* Added changes to allow deferred functions to be picked up for tracing
* Fix issue to avoid printing stack for a simple trace option
* Moving most tests to integration2_test.go and keeping only one in dlv_test.go
* Moving most tests to integration2_test.go and keeping only one in dlv_test.go
* Adding panic-defer test case
* Moved rest of the tests to integration2_test.go
* addressing review comments: folding Functions and FunctionsDeep, reducing branches by using depth prefix, wrap using %w and other comments
* Optimize traversal and parts of printing trace point function and modify trace output layout
and adjust tests accordingly
* Resolved error occurring due to staticcheck
* Implemented traversal algorithm using breadth first search
* Addressing review comments on the breadth first search implementation and
other comments
* Inline filterRuntimeFuncs and remove duplicate initialization
Allows for a user to specify the breakpoint condition directly
when creating the breakpoint. The new syntax looks like the
following:
```
break <name> <locspec> [if <expression>]
```
Also updates docs to include more examples and locspec description
instead of directing users to the online / source documentation.
This command lists the packages included in the debugee.
The implementation utilizes "ListPackagesBuildInfo" RPC.
In order to support server-side filtering like `sources` and other
commands, expanded the ListPackagesBuildInfo RPC to take an optional
filter field.
Adds -chan option to the goroutines command to list only the goroutines
running on a specified channel.
Also when printing a variable if it is a channel also print the list of
goroutines that are waiting on it.
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.
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.
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
The tree view of the project layout seemed to show that "github.com",
"cmd", and "pkg" were all in the same directory. The usage later in the
document (and normal go layout) would have them as subdirectories.
The new tree output was generated with the below:
(cd `mktemp -d`
mkdir -p github.com/me/foo/{cmd/foo,pkg/baz}
touch github.com/me/foo/{cmd/foo/main,pkg/baz/bar{_test,}}.go
tree -n --noreport github.com/me/foo
)
Adds field to breakpoint struct to track how a breakpoint was
originally set, moves the logic for disabling and enabling a breakpoint
to proc.
This will allow creating suspended breakpoints that are automatically
enabled when a plugin is loaded. When follow exec mode is implemented
it will also be possible to automatically enable breakpoints (whether
or not they were suspended) on new child processes, as they are
spawned.
It also improves breakpoint restore after a restart, before this after
a restart breakpoints would be re-enabled using their file:line
position, for breakpoints set using a function name or a location
expression this could be the wrong location after a recompile.
Updates #1653
Updates #2551
Remove leftover references to $GOPATH in documentation, change script
that generates markdown documentation to look for substrings that start
with "Documentation/" instead.
* terminal/command: 'goroutines' command add new flags '-exec command'
Support run command on every goroutine.
Fixes#3043
* terminal/command: 'goroutines' command add new flags '-exec command'
Support run command on every goroutine.
Fixes#3043
* terminal/command: add -per-g-hitcount option to condition command
Support use per goroutine hitcount as hintcond operand.
Fixes#3050
Co-authored-by: roketyyang <roketyyang@tencent.com>
Often in the CLI documentation we were to inputs as linespec
when in reality we mean locspec which is a
location specifier, not necessarily a
line specifier.
* service: Implement BuildID
Parse the BuildID of executables and provides it over the RPC
service.
Signed-off-by: Morten Linderud <morten@linderud.pw>
* command: Support debuinfod for file listing
Signed-off-by: Morten Linderud <morten@linderud.pw>
* debuginfod: create debuginfod package for common code
We remove the duplicated code and provide our a new debuginfod package.
Signed-off-by: Morten Linderud <morten@linderud.pw>
* starlark: Workaround for 'build_i_d'
Signed-off-by: Morten Linderud <morten@linderud.pw>
* command: Ensure we only overwrite path when one has been found
Signed-off-by: Morten Linderud <morten@linderud.pw>
* bininfo: Inline parseBuildID
Signed-off-by: Morten Linderud <morten@linderud.pw>
Adds a transcript command that appends all command output to a file.
This command is equivalent to gdb's 'set logging'.
As part of this refactor the pkg/terminal commands to always write to a
io.Writer instead of using os.Stdout directly (through
fmt.Printf/fmt.Println).
Fixes#2237
This could probably be more user-friendly, in that you can't give a name
to such a breakpoint. To add support for names, we would need to try
a single arg first as a location, and if that fails try it as a name for
current line. That seems somewht dubious, so I didn't try.
Adds watchpoint support to gdbserver backend for rr debugger and
debugserver on macOS/amd64 and macOS/arm64.
Also changes stack watchpoints to support reverse execution.
* terminal,service: add way to see internal breakpoints
Now that Delve has internal breakpoints that survive for long periods
of time it will be useful to have an option to display them.
* proc,terminal,service: support stack watchpoints
Adds support for watchpoints on stack allocated variables.
When a stack variable is watched, in addition to the normal watchpoint
some support breakpoints are created:
- one breakpoint inside runtime.copystack, used to adjust the address
of the watchpoint when the stack is resized
- one or more breakpoints used to detect when the stack variable goes
out of scope, those are similar to the breakpoints set by StepOut.
Implements #279
Before this change when you typed `help` at the Delve prompt you would
only see the following:
```
examinemem (alias: x) Examine memory:
```
Now with this patch the output is more descriptive:
```
examinemem (alias: x) Examine raw memory at the given address.
```
* terminal: improve 'on' command
Adds the ability to edit the list of commands executed after stopping
on a breakpoint, as well as converting a breakpoint into a tracepoint
and vice versa.
Prior to this it was possible to add commands to a breakpoint but
removing commands or changing a breakpoint into a tracepoint, or vice
versa, could only be done by removing and recreating the breakpoint.
Adds filtering and grouping to the goroutines command.
The current implementation of the goroutines command is modeled after
the threads command of gdb. It works well for programs that have up to
a couple dozen goroutines but becomes unusable quickly after that.
This commit adds the ability to filter and group goroutines by several
different properties, allowing a better debugging experience on
programs that have hundreds or thousands of goroutines.
Changes the expression evaluation code so that register names, when not
shadowed by local or global variables, will evaluate to the current
value of the corresponding CPU register.
This allows a greater flexibility with displaying CPU registers than is
possible with using the ListRegisters API call. Also it allows
debuggers users to view register values even if the frontend they are
using does not implement a register view.
* examinememory: evaluate addr as expression
This makes it easy to read memory locations at an offset of a known
address, e.g.:
x 0xc000046800 + 32
* use feedback from @aarzilli
- expression mode is now enabled via -x flag
- support "-x var", "-x &var" in addition to "-x <addr expr>"
- some refactoring
* add test cases
* deal with double spaces
* update docs
* add new failing test
* fix docs
* simplify implementation, update test & docs
* Fix docs
Changes print so a format argument can be specified by using '%' as
prefix. For example:
print %x d
will print variable 'd' in hexadecimal. The interpretarion of the
format argument is the same as that of fmt's package.
Fixes#1038Fixes#1800Fixes#2159
* Adds toggle command
Also adds two rpc2 tests for testing the new functionality
* Removes Debuggers' ToggleBreakpoint method
rpc2's ToggleBreakpoint now calls AmendBreakpoint
Refactors the ClearBreakpoint to avoid a lock.