From 7bc5c369fae6dda3657467aee14e352a66b4270f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 4 Nov 2021 15:31:28 -0400 Subject: gdb: introduce "set index-cache enabled", deprecate "set index-cache on/off" The "set index-cache" command is used at the same time as a prefix command (prefix for "set index-cache directory", for example), and a boolean setting for turning the index-cache on and off. Even though I did introduce that, I now don't think it's a good idea to do something non-standard like this. First, there's no dedicated CLI command to show whether the index-cache is enabled, so it has to be custom output in the "show index-cache handler". Also, it means there's no good way a MI frontend can find out if the index-cache is enabled. "-gdb-show index-cache" doesn't show it in the MI output record: (gdb) interpreter-exec mi "-gdb-show index-cache" ~"\n" ~"The index cache is currently disabled.\n" ^done,showlist={option={name="directory",value="/home/simark/.cache/gdb"}} Fix this by introducing "set/show index-cache enabled on/off", regular boolean setting commands. Keep commands "set index-cache on" and "set index-cache off" as deprecated aliases of "set index-cache enabled", with respectively the default arguments "on" and "off". Update tests using "set index-cache on/off" to use the new command. Update the regexps in gdb.base/maint.exp to figure out whether the index-cache is enabled or not. Update the doc to mention the new commands. Change-Id: I7d5aaaf7fd22bf47bd03e0023ef4fbb4023b37b3 --- gdb/doc/gdb.texinfo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/doc') diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 308a97a..fc8e5bd 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -21795,14 +21795,14 @@ Indices only work when using DWARF debugging information, not stabs. @cindex automatic symbol index cache It is possible for @value{GDBN} to automatically save a copy of this index in a cache on disk and retrieve it from there when loading the same binary in the -future. This feature can be turned on with @kbd{set index-cache on}. The -following commands can be used to tweak the behavior of the index cache. +future. This feature can be turned on with @kbd{set index-cache enabled on}. +The following commands can be used to tweak the behavior of the index cache. @table @code @kindex set index-cache -@item set index-cache on -@itemx set index-cache off +@item set index-cache enabled on +@itemx set index-cache enabled off Enable or disable the use of the symbol index cache. @item set index-cache directory @var{directory} -- cgit v1.1