We are already importing v3 indirectly for github.com/spf13/cobra/doc,
update our own dependency to v3 as well so that we can delete one
module from the vendor directory.
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
New config "tab" allows user to set a string instead of literal tab
(e.g. "... ").
New config "source-list-tab-color" allows that string to be colored.
This builds on top of the `updateColorScheme` change
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
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