From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22938 invoked by alias); 20 Jul 2012 18:01:38 -0000 Received: (qmail 22922 invoked by uid 22791); 20 Jul 2012 18:01:36 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BJ,TW_JC,TW_YM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gh0-f201.google.com (HELO mail-gh0-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jul 2012 18:01:20 +0000 Received: by ghbg15 with SMTP id g15so472745ghb.0 for ; Fri, 20 Jul 2012 11:01:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:content-type:content-transfer-encoding:message-id:date :to:cc:subject:in-reply-to:references:x-mailer:from :x-gm-message-state; bh=r5+P0YrBUFWzct8RJaIveOoQcCdJr2JalKbLBVSdloA=; b=kLQMBnqG+kRqU9V/qb7heYgac45A0O5PMtPSpSELb2Nx9fCIKGpdQBcMj9Fh6oB7zb 2KtpWDP4m6a+nQLBwwky8wd00aE1j7r+1qAWO9g8Lwc3s4ql8cE1/LHt6YOp2wED/2Kz lV04DmicwKujB7TSgYP/RnFrqa8N0A3fo0/xgFcE2O/bmcxqgtjVdENOhZNEVmkH/9Du j/iipWF/SXjmO4T9ECPTJ9Fwjj7u9b+J9nrx1Xj6LSVimSSl5/Y3qQ5kCrWIWnZrQ9q7 bxO8OkqF2tRaEv3F+FMMgYyxtk0Rvd+g27PWQ7ou4FLLGvU35MOApm8AeUtFMhTX00/D BqsA== Received: by 10.236.181.34 with SMTP id k22mr3052103yhm.46.1342807280057; Fri, 20 Jul 2012 11:01:20 -0700 (PDT) Received: by 10.236.181.34 with SMTP id k22mr3052097yhm.46.1342807280005; Fri, 20 Jul 2012 11:01:20 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id r48si1523583yhm.3.2012.07.20.11.01.20 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 20 Jul 2012 11:01:20 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 5C790100048; Fri, 20 Jul 2012 11:01:19 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20489.40174.602435.247343@ruffy2.mtv.corp.google.com> Date: Fri, 20 Jul 2012 18:01:00 -0000 To: Eli Zaretskii Cc: jan.kratochvil@redhat.com, gdb-patches@sourceware.org Subject: Re: [RFA, doc RFA] New option set use-deprecated-index-sections In-Reply-To: <83fw8n8thj.fsf@gnu.org> References: <20120717214257.GA9394@host2.jankratochvil.net> <20487.14790.662664.583456@ruffy2.mtv.corp.google.com> <20120718233303.GA32519@host2.jankratochvil.net> <83liif91io.fsf@gnu.org> <83hat38ztr.fsf@gnu.org> <20488.20773.692409.554409@ruffy2.mtv.corp.google.com> <83fw8n8thj.fsf@gnu.org> From: dje@google.com X-Gm-Message-State: ALoCoQkkcSuMY1d3tGF4RgFupfhaVCkxjq6meZwVJXqulIO3N445ZIPitrtHgKEdygT8+pSXRsU96HrHqvDXFlZT27o/TMA7lTnRLWTQO+bHC41Arw4f6QLjEK2VN7lgplW3RWVf86+etZVjxVEHUbKj3aL2K3abl/9nqnadyJztM1RNsk/iu5G3tXDUnQM+8CJ10Ri9xy7Q X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00412.txt.bz2 Eli Zaretskii writes: > > Date: Thu, 19 Jul 2012 11:25:41 -0700 > > cc: gdb-patches@sourceware.org > > From: dje@google.com > > > > How about this? > > Fine with me, thanks. Thanks. And I committed this to the 7.5 branch. 2012-07-20 Doug Evans * NEWS: Document new options "set/show use-deprecated-index-sections", and delete reference to --use-deprecated-index-sections. * symfile.h (use_deprecated_index_sections): Delete. * dwarf2read.c (use_deprecated_index_sections): Make static. (read_index_from_section): Update wording of how to load deprecated index sections. (_initialize_dwarf2_read): New options "set/show use-deprecated-index-sections". * main.c (captured_main): Delete --use-deprecated-index-sections. doc/ * gdb.texinfo (Mode Options): Delete --use-deprecated-index-sections. (Index Files): Document how to control the use of deprecated index sections. (Index Section Format): Replace --use-deprecated-index-sections with "set use-deprecated-index-sections on". Index: NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.533.2.1 diff -u -p -r1.533.2.1 NEWS --- NEWS 18 Jul 2012 15:56:55 -0000 1.533.2.1 +++ NEWS 20 Jul 2012 17:57:19 -0000 @@ -112,11 +112,11 @@ * The .gdb_index section has been updated to include symbols for inlined functions. GDB will ignore older .gdb_index sections by default, which could cause symbol files to be loaded more slowly - until their .gdb_index sections can be recreated. The new option - --use-deprecated-index-sections will cause GDB to use any older - .gdb_index sections it finds. This will restore performance, but - the ability to set breakpoints on inlined functions will be lost - in symbol files with older .gdb_index sections. + until their .gdb_index sections can be recreated. The new command + "set use-deprecated-index-sections on" will cause GDB to use any older + .gdb_index sections it finds. This will restore performance, but the + ability to set breakpoints on inlined functions will be lost in symbol + files with older .gdb_index sections. The .gdb_index section has also been updated to record more information about each symbol. This speeds up the "info variables", "info functions" @@ -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 20 Jul 2012 17:57:19 -0000 @@ -93,7 +93,7 @@ static int dwarf2_die_debug = 0; static int check_physname = 0; /* When non-zero, do not reject deprecated .gdb_index sections. */ -int use_deprecated_index_sections = 0; +static int use_deprecated_index_sections = 0; static int pagesize; @@ -2558,15 +2558,17 @@ dwarf2_read_index (struct objfile *objfi Versions earlier than 6 did not emit psymbols for inlined functions. Using these files will cause GDB not to be able to set breakpoints on inlined functions by name, so we ignore these - indices unless the --use-deprecated-index-sections command line - option was supplied. */ + indices unless the user has done + "set use-deprecated-index-sections on". */ if (version < 6 && !use_deprecated_index_sections) { static int warning_printed = 0; if (!warning_printed) { - warning (_("Skipping deprecated .gdb_index section in %s, pass " - "--use-deprecated-index-sections to use them anyway"), + warning (_("\ +Skipping deprecated .gdb_index section in %s.\n\ +Do \"set use-deprecated-index-sections on\" before the file is read\n\ +to use the section anyway."), objfile->name); warning_printed = 1; } @@ -19387,6 +19389,18 @@ 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, deprecated .gdb_index sections are used anyway.\n\ +Normally they are ignored either because of a missing feature or\n\ +performance issue.\n\ +Warning: This option must be enabled before gdb reads the file."), + NULL, + NULL, + &setlist, &showlist); + c = add_cmd ("gdb-index", class_files, save_gdb_index_command, _("\ Save a gdb-index file.\n\ Index: main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.110 diff -u -p -r1.110 main.c --- main.c 2 Jul 2012 12:05:00 -0000 1.110 +++ main.c 20 Jul 2012 17:57:19 -0000 @@ -471,8 +471,6 @@ captured_main (void *data) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, - {"use-deprecated-index-sections", no_argument, - &use_deprecated_index_sections, 1}, {0, no_argument, 0, 0} }; Index: symfile.h =================================================================== RCS file: /cvs/src/src/gdb/symfile.h,v retrieving revision 1.109 diff -u -p -r1.109 symfile.h --- symfile.h 24 May 2012 22:14:35 -0000 1.109 +++ symfile.h 20 Jul 2012 17:57:19 -0000 @@ -676,9 +676,6 @@ extern void dwarf2_build_frame_info (str void dwarf2_free_objfile (struct objfile *); -/* Whether to use deprecated .gdb_index sections. */ -extern int use_deprecated_index_sections; - /* From mdebugread.c */ /* Hack to force structures to exist before use in parameter list. */ 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 20 Jul 2012 17:57:20 -0000 @@ -1247,13 +1247,6 @@ memory usage after it completes each com This option causes @value{GDBN} to print its version number and no-warranty blurb, and exit. -@item -use-deprecated-index-sections -@cindex @code{--use-deprecated-index-sections} -This option causes @value{GDBN} to read and use deprecated -@samp{.gdb_index} sections from symbol files. This can speed up -startup, but may result in some functionality being lost. -@xref{Index Section Format}. - @end table @node Startup @@ -16753,6 +16746,28 @@ $ 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. +To tell @value{GDBN} to use a deprecated index section anyway +specify @code{set use-deprecated-index-sections on}. +The default is @code{off}. +This can speed up startup, but may result in some functionality being lost. +@xref{Index Section Format}. + +@emph{Warning:} Setting @code{use-deprecated-index-sections} to @code{on} +must be done before gdb reads the file. The following will not work: + +@smallexample +$ gdb -ex "set use-deprecated-index-sections on" +@end smallexample + +Instead you must do, for example, + +@smallexample +$ gdb -iex "set use-deprecated-index-sections on" +@end smallexample + 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. @@ -40408,7 +40423,7 @@ Version 4 uses a different hashing funct Version 6 includes symbols for inlined functions, whereas versions 4 and 5 do not. Version 7 adds attributes to the CU indices in the symbol table. @value{GDBN} will only read version 4, 5, or 6 indices -if the @code{--use-deprecated-index-sections} option is used. +by specifying @code{set use-deprecated-index-sections on}. @item The offset, from the start of the file, of the CU list.