Commit Graph

16 Commits

Author SHA1 Message Date
Alessandro Arzilli
650f2d5e23
terminal: clear substitute path rules cache when config is used (#3567)
Fixes #3565
2023-11-16 10:43:23 -08: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
Derek Parker
9230a97210
pkg/terminal: fix handling list colors via config (#3240)
Parsing the source list color when set during a Delve debug session
resulted in unexpected errors. Additionally the changes were not reflected
in the current session, forcing the user to save the config and start a
new session. This patch fixes those issues.
2023-01-04 10:22:19 +01:00
Suzy Mueller
922c4cebd4
service/dap: add config expressions to evaluate requests (#2750)
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.
2021-10-29 19:35:13 -07:00
Johannes Altmanninger
f5105c57f7
terminal: config -list to print strings inside interfaces in quotes (#2680)
Commit 3d6bbbe9 made "config -list" print strings in quotes to avoid
the strings being interpreted as terminal escape codes.  This commit
does the same for "source-list-line-color", which is a raw interface.
This fixes "config -list" with a config like

	source-list-line-color: "\x1b[34m"

The "int" variant is already printed correctly, so just use the
default case for that.
2021-09-01 09:59:15 -07:00
Alessandro Arzilli
3d6bbbe92a
terminal: config -list should print strings in quotes (#2605)
Commit 8e91d3b0b added a number of configuration options to control the
colors of sytnax highlighting, unfortunately 'config -list' will print
all of those to stdout without quoting them, resulting in the color of
the last one being applied to all subsequent text.

Change 'config -list' to print strings in quotes so that we don't
accidentally send escape sequences to the terminal.
2021-08-23 11:28:27 -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
Derek Parker
ad75f78c4e
*: Fix go vet complaints (#1935)
* *: Fix go vet struct complaints

* *: Fix struct vet issue on linux

* *: Ignore proc/native in go vet check

We have to do some unsafe pointer manipulation that will never make go
vet happy within the proc/native package. Ignore it for runs of go vet.
2020-03-18 09:25:32 -07:00
chainhelen
f5608c7712 pkg/terminal: tolerate spurious spaces between arguments of cli.
Expression such as:
   config show-location-expr  true
   disassemble -a  0x4a23a0 0x4a23f2
   disassemble -a 0x4a23a0  0x4a23f2
should all execute correctly.

Extend #795.
2020-01-20 10:47:56 -08:00
TerrySolar
52c395eb64 fix panic when config value set 0 (#1723) 2019-10-21 10:40:37 -07:00
Alessandro Arzilli
1758823429 terminal: update return value load configuration when it changes (#1602)
Fixes #1598
2019-07-08 10:27:31 -07:00
Derek Parker
4c9a72e486 *: Update import name to github.com/go-delve/delve
The repository is being switched from the personal account
github.com/derekparker/delve to the organization account
github.com/go-delve/delve. This patch updates imports and docs, while
preserving things which should not be changed such as my name in the
CHANGELOG and in TODO comments.
2019-01-04 19:43:13 +01:00
Josh Soref
1d3b41f64e all: Spelling 2018-03-20 11:05:35 +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