This changes adds the support to replace relative paths sources with "" as rapresenting current directory.
For example:
Rule like '{from: "", to: "/my/project"}' will map path "src/my/code.go" into "/my/project/src/my/code.go"
Rule like '{from: "/my/project", to: ""}' will map path "/my/project/src/my/code.go" into "src/my/code.go"
Fixes#3082
Adds ability to show current position as disassembly instead of source
listing every time execution stops. Change default to show disassembly
after step-instruction and source listing in every other case.
Fixes#2878
Go 1.19 also formats doc comments according to the new godoc syntax.
Some of our comments, especially unexported symbols did not conform to
the godoc syntax and therefore are mangled by 'go fmt'.
This PR runs 'go fmt' from go1.19 on everything and manually fixes the
problems.
See also:
https://github.com/golang/proposal/blob/master/design/51082-godocfmt.md
We want to provide more flexibility for users to make changes to their configurations while the debug session is running. This could be accomplished by creating a custom request, but that were require a new UI as well, and every client of dlv dap to provide its own UI for this. By using the evaluate context, users can use the already existing debug console to change their configurations.
This change includes a refactor of the terminal code in order to share the code with the dap package.
This change provides a very similar to UI as the terminal package, but there are different configuration options that are DAP specific. We plan to use this same mechanism to expose a few other commands including "sources" to help users debug an ineffective substitutePath configuration.
LoadConfig warnings should obey the logflags configuration and should
also be delayed until after the "listening at" message, which should
always be the first thing output.
Co-authored-by: Suzy Mueller <suzmue@golang.org>
The string variant is more powerful and can be passed
directly to "echo -e" / "printf" and friends.
Remove the mention of the integer variant from the default config. This
makes the option appear more consistent with other color options.
The user shouldn't care about the historic differences.
The option is "source-list-line-count". It defaults to 5, which was previously
hardcoded in printfile(), but now you can change it dynamically, for instance:
$ config source-list-line-count 20
$ list
* config/config.go
This change checks for the environmental variable XDG_CONFIG_HOME
before storing the configuration file in the home directory.
Closes#1454
* config/config.go
This change attempts to move the previous config file location to the
new XDG_CONFIG_HOME compliant location on linux systems or when
XDG_CONFIG_HOME is set.
This change removes the old config file location if the file is
successfully moved.
* config/config.go
Consolidate messages about config moving and clean up into one.
Remove extraneous newlines.
* pkg/config: config path error messages print to stderr
This change updates the output location of error messages related to
the config path. This will prevent clients from getting unexpected output
when an error occurs.
* pkg/config: Update path used when returning unable to move config error
This change fixes the error message when Delve was unable to move the config. Previously returned a FileInfo object not the file path.
* pkg/config: Remove check for stderr when printing error messages
* pkg/config: Move success message for moving config to stderr
This prevents the success message from being printed to stdout and
breaking frontends.
* pkg/config: Rename variable to be more descriptive
* pkg/config: Using current directory to store config if getting user details fails.
This patch is to use current directory to store config file.
user.Current() call fails when dlv is run inside a container. (Alpine)
* Addressing comments
* Removed whitespace
If DebugInfoDirectories is empty, set it to same value as we have in the
default configuration.
This is useful for users which already have an older config file.
Otherwise the later call to ioutil.ReadAll will return an empty array.
This issue is visible from the user's perspective due to the new
debug-info-directories parameter, which does have a value in the default
config.
As a consequence, the first 'dlv' invocation fails to find the separate
debug info files, while the second one works as expected:
$ ./dlv core /usr/bin/dockerd-current /case/dockerd.1234
could not find external debug info file
$ ./dlv core /usr/bin/dockerd-current /case/dockerd.1234
Type 'help' for list of commands.
(dlv) exit
Previously the file handle for the newly created default config was
being closed and thrown away as opposed to returned to the caller to
finish setting up config for the rest of the process. This patch changes
to return a handle to the newly created config so setup can happen as
normal. This fixes a bug where Delve can crash on first run when a
config is not present on the system.
Fixes#1129
Adds a configuration option (show-location-expr) that when activated
will cause the whatis command to also print the DWARF location
expression for a variable.
* Fix various issues detected by megacheck
I've ran honnef.co/go/tools/cmd/megacheck and fixed a few of the
things that came up there.
* Cleanup using Gogland