[RFA, doc RFA] New option set use-deprecated-index-sections

dje
2012-07-17T21:24:31Z

Hi.

I have a need to be able to control the use of deprecated index sections
with an option, instead of the command line.

I was going to wait to apply this until after 7.5,
but with the new "-iex" option I realize that the new
"--use-deprecated-index-sections" option could be considered redundant.
So I'm thinking about deleting that as well, in favor of having just this.

What do y'all think?

2012-07-17 Doug Evans <dje@google.com>

* NEWS: Document new options "set/show use-deprecated-index-sections".
* dwarf2read.c (_initialize_dwarf2_read): New options
"set/show use-deprecated-index-sections".

doc/
* gdb.texinfo (Index Files): Document how to control the use of
deprecated index sections.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.533
diff -u -p -r1.533 NEWS
--- NEWS 4 Jul 2012 20:49:56 -0000 1.533
+++ NEWS 17 Jul 2012 21:17:47 -0000
@@ -137,6 +137,10 @@

* New commands

+ ** "set use-deprecated-index-sections on|off"
+ "show use-deprecated-index-sections on|off"
+ Controls the use of deprecated .gdb_index sections.
+
** "catch load" and "catch unload" can be used to stop when a shared
library is loaded or unloaded, respectively.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.687
diff -u -p -r1.687 dwarf2read.c
--- dwarf2read.c 16 Jul 2012 03:22:40 -0000 1.687
+++ dwarf2read.c 17 Jul 2012 21:13:14 -0000
@@ -19387,6 +19387,17 @@ the demangler."),
NULL, show_check_physname,
&setdebuglist, &showdebuglist);

+ add_setshow_boolean_cmd ("use-deprecated-index-sections",
+ no_class, &use_deprecated_index_sections, _("\
+Set whether to use deprecated gdb_index sections."), _("\
+Show whether to use deprecated gdb_index sections."), _("\
+When enabled .gdb_index sections that have been deprecated are used anyway.\n\
+Normally they are ignored either because of a missing feature or\n\
+performance issue."),
+ NULL,
+ NULL,
+ &setlist, &showlist);
+
c = add_cmd ("gdb-index", class_files, save_gdb_index_command,
_("\
Save a gdb-index file.\n\
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.990
diff -u -p -r1.990 gdb.texinfo
--- doc/gdb.texinfo 5 Jul 2012 01:08:24 -0000 1.990
+++ doc/gdb.texinfo 17 Jul 2012 21:13:15 -0000
@@ -16753,6 +16753,26 @@ $ objcopy --add-section .gdb_index=symfi
--set-section-flags .gdb_index=readonly symfile symfile
@end smallexample

+@value{GDBN} will normally ignore older versions of @file{.gdb_index}
+sections that have been deprecated. Usually they are deprecated because
+they are missing a new feature or have performance issues.
+
+There are two ways to control the use deprecated index sections:
+
+@table @code
+
+@item -use-deprecated-index-sections
+Pass this command line option when starting @value{GDBN}.
+
+@item set use-deprecated-index-sections
+@kindex set use-deprecated-index-sections
+Set this option to control the treatment of deprecated index sections.
+When @code{on}, index sections are used even if they are deprecated.
+When @code{off}, only current versions of index sections are used.
+The default is @code{off}.
+
+@end table
+
There are currently some limitation on indices. They only work when
for DWARF debugging information, not stabs. And, they do not
currently work for programs using Ada.