Commit Graph

26 Commits

Author SHA1 Message Date
Alessandro Arzilli
a151be7eca
go.mod: update gopkg.in/yaml to v3 (#3776)
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.
2024-07-11 08:04:47 -07:00
Alessandro Arzilli
8df2b6bedb
terminal: add prompt color option (#3648)
Add option to configure prompt color.

Fixes #3603
2024-02-07 11:07:11 -08:00
Alessandro Arzilli
9405996b5d
terminal: add color highlighting to stacktraces (#3649)
Adds configurable highlighting for function names and filenames in stack traces.

Fixes #720
2024-02-07 11:06:30 -08:00
Oleksandr Redko
899ba72505
all: replace deprecated io/ioutil with io and os (#3509) 2023-09-25 11:41:59 -07:00
罗泽轩
801a9109c7
trace: add timestamp to the output (#3358)
Fix #3356
2023-05-08 10:41:47 -07:00
Alessandro Arzilli
13ad7dc1d5
*: misc improvements to config command and substitute-path rules (#3335)
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
2023-05-02 12:23:59 -07:00
Tim Hockin
62335703d2
terminal: Add config options for tab printing (#3243)
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
2023-01-05 14:09:03 +01:00
Alessandro Arzilli
1fe03e728c
terminal: add ability to show disassembly instead of source (#3047)
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
2022-07-14 14:08:47 -07:00
Alessandro Arzilli
6cf7a7149d
cmd/dlv,config: obey logflags config for LoadConfig warnings (#2701)
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>
2021-10-13 18:46:20 -07:00
Johannes Altmanninger
45f44bc218
Prefer string variant for source-list-line-color config option (#2676)
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.
2021-09-01 10:03:58 -07:00
Alessandro Arzilli
8e91d3b0bf
terminal: Go syntax highlighting for listings (#2294)
Fixes #1273
2021-01-28 07:08:14 -08:00
Anders Kaare
71a460fc0f
config: add option for printfile() line count (#2043)
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
2020-05-11 09:50:25 -07:00
chainhelen
37bee98a88 pkg/config: add disassemble-flavor option for config
Allow user to specify output syntax flavor of assembly in the
disassemble command.

Close #415
2020-04-23 12:10:05 -07:00
Michail Safronov
89d2167c31 pkg/config: add max-variable-recurse parameter (#1626)
* add max-variable-recurse parameter
2019-07-23 14:40:35 -07:00
Gregorio Martinez
c1a39c6fe0 pkg/config: try to use XDG_CONFIG_HOME when present
* 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
2019-02-11 14:22:44 -08:00
Chandrashekhara A
6611fbe919 pkg/config: Using current directory for config as fallback (#1425)
*  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
2018-11-28 13:21:21 -08:00
Sergio Lopez
dc208bc0c3 pkg/config: Use a default value for DebugInfoDirectories
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.
2018-11-26 09:54:31 -08:00
Sergio Lopez
46923142cb pkg/config: Rewind *File after writeDefaultConfig
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
2018-11-26 09:54:31 -08:00
Derek Parker
51c342c6b7 pkg/prog: Improve support for external debug info
Adds a config file option to allow specifying a list of directories to
search in when looking for seperate external debug info files.

Fixes #1353
2018-11-08 10:16:42 -08:00
Derek Parker
2f746e1d3c pkg/config: Clean up godoc lint issues 2018-11-08 10:16:42 -08:00
Russ Magee
4e4ed02948 config,terminal: Add source-list-line-color configuration option
This change adds a config flag to specify the foreground color of
line numbers for the source list command.
2018-10-10 11:24:29 -07:00
Derek Parker
678576d2ce config: Return handle for created default config (#1130)
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
2018-02-20 20:24:05 +01:00
aarzilli
1758f8523a pkg/terminal: print DWARF location expression with whatis
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.
2017-12-20 16:34:47 -08:00
aarzilli
48288edd18 terminal: add config command
Fixes #927, #644
2017-09-08 10:27:32 -07:00
Florin Pățan
32a005de2b Fix various issues detected by megacheck (#880)
* 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
2017-06-29 11:15:59 -07:00
Derek Parker
53f0d24057 Move top-level packages into pkg 2017-02-08 12:17:19 -08:00