From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90439 invoked by alias); 1 Dec 2017 04:35:38 -0000 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 Received: (qmail 90424 invoked by uid 89); 1 Dec 2017 04:35:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Dec 2017 04:35:36 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44F41267D8; Fri, 1 Dec 2017 04:35:35 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED19D5D6A8; Fri, 1 Dec 2017 04:35:34 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches , Joel Brobecker , Yao Qi , Eli Zaretskii Subject: Re: [PATCH v4] Add support for the readnever concept References: <1467838463-15786-1-git-send-email-brobecker@adacore.com> <20171130002529.10592-1-sergiodj@redhat.com> <6765d36f-8603-9cd3-0476-801a5bfe0865@redhat.com> Date: Fri, 01 Dec 2017 04:35:00 -0000 In-Reply-To: <6765d36f-8603-9cd3-0476-801a5bfe0865@redhat.com> (Pedro Alves's message of "Thu, 30 Nov 2017 11:52:58 +0000") Message-ID: <87shcvgj55.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00000.txt.bz2 On Thursday, November 30 2017, Pedro Alves wrote: > On 11/30/2017 12:25 AM, Sergio Durigan Junior wrote: > >> - Split off the fix to 'symbol-file' command argument parsing. This >> patch depends on it >> (). > > This info above conflicts with ... > >> While implementing the code for the 'symbol-file' command, I noticed a >> bug in 'symbol_file_command': GDB adds the symbol file before >> finishing parsing all the options, which means that the position of an >> option in the command impacts whether it will be considered or not. I >> changed the code there in order to only add the symbol file after all >> options have been parsed. > > ... this info here. The patch still has that bit... You're right, I'll remove this bit since there's a whole new patch (with all its glorious versions) to implement that. >> >> It's also worth mentioning that this patch tests whether GDB correctly >> fails to initialize if both '--readnow' and '--readnever' options are >> passed. We didn't have any infrastructure to test that, so I added a >> new version of 'gdb_spawn', called 'gdb_spawn_ignore_error', which can >> be used to start a GDB that will fail without compromising the entire >> testcase. > > This is stale. Removed the part that refers to 'gdb_spawn_ignore_error'. >> gdb/testsuite/ChangeLog: >> >> 2017-11-29 Joel Brobecker >> Sergio Durigan Junior >> Pedro Alves >> >> * gdb.base/readnever.c, gdb.base/readnever.exp: New files. >> * lib/gdb.exp (default_gdb_spawn): Add 'ignore_error' >> parameter. Handle case when 'ignore_error' is set. >> (gdb_spawn_ignore_error): New function. > > Also stale... Removed the part about lib/gdb.exp. >> @@ -699,7 +700,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) >> } >> } >> >> - bfd_map_over_sections (abfd, coff_locate_sections, (void *) info); >> + if (!readnever_symbol_files && !(objfile->flags & OBJF_READNEVER)) >> + bfd_map_over_sections (abfd, coff_locate_sections, (void *) info); > > I realized something: is it really ever possible to get here with > > readnever_symbol_files && !(objfile->flags & OBJF_READNEVER) > > ?? > > If readnever_symbol_files is set, then it'll have been propagated to > objfile->flags before we get here, no? Hm, I think so, yes. I mean, assuming that objfile != NULL when we call the readers, then yes; we always call symbol_file_add_with_addrs which is responsible for propagating the flag. > So references to the global readnever_symbol_files can (and should) > be removed from the readers, right? This removes the need for > the new '#include "top.h"'s too, so please remove those from > the patch along the way. OK, done. >> >> if (info->stabsects) >> { >> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >> index 4f552225aa..a3127dd637 100644 >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -1037,6 +1037,15 @@ Read each symbol file's entire symbol table immediately, rather than >> the default, which is to read it incrementally as it is needed. >> This makes startup slower, but makes future operations faster. >> >> +@item --readnever >> +@cindex @code{--readnever}, command-line option >> +Do not read each symbol file's symbolic debug information. This makes >> +startup faster but at the expense of not being able to perform >> +symbolic debugging. DWARF unwind information is also not read, >> +meaning backtraces may become incomplete or inaccurate. One use of >> +this is when a user simply wants to do the following sequence: attach, >> +dump core, detach. Loading the debugging information in this case is >> +an unnecessary cause of delay. >> @end table >> >> @node Mode Options >> @@ -18576,6 +18585,14 @@ tables by using the @samp{-readnow} option with any of the commands that >> load symbol table information, if you want to be sure @value{GDBN} has the >> entire symbol table available. >> >> +@cindex @code{-readnever}, option for symbol-file command >> +@cindex never read symbols >> +@cindex symbols, never read >> +@item symbol-file @r{[} -readnever @r{]} @var{filename} >> +@itemx file @r{[} -readnever @r{]} @var{filename} >> +You can instruct @value{GDBN} to never read the symbolic information >> +contained in @var{filename} by using the @samp{-readnever} option. > > Maybe copy the rationale for this found in "--readnever" here > or xref the "--readnever" command line option? I used an xref. > >> #define READNOW_HELP \ >> "The '-readnow' option will cause GDB to read the entire symbol file\n\ >> immediately. This makes the command slower, but may make future operations\n\ >> -faster." >> +faster.\n" >> + >> +#define READNEVER_HELP \ >> + "The '-readnever' option will prevent GDB from reading the symbol file's\n\ >> +symbolic debug information." >> > > Why not merge these two macros in one? We'll always want to > use them together, in the same order? You could rename the > macro to READNOW_READNEVER_HELP for example. Did it. I'll wait until we sort out the patch to extend the argument parser of '{add-,}symbol-file' before I submit v5. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/