public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>,
	GDB Patches <gdb-patches@sourceware.org>
Cc: Joel Brobecker <brobecker@adacore.com>,
	Yao Qi <qiyaoltc@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH v4] Add support for the readnever concept
Date: Thu, 30 Nov 2017 11:53:00 -0000	[thread overview]
Message-ID: <6765d36f-8603-9cd3-0476-801a5bfe0865@redhat.com> (raw)
In-Reply-To: <20171130002529.10592-1-sergiodj@redhat.com>

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
>   (<https://sourceware.org/ml/gdb-patches/2017-11/msg00799.html>).

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...

> 
> 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.

> gdb/testsuite/ChangeLog:
> 
> 2017-11-29  Joel Brobecker  <brobecker@adacore.com>
> 	    Sergio Durigan Junior  <sergiodj@redhat.com>
> 	    Pedro Alves  <palves@redhat.com>
> 
> 	* 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...

> @@ -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?

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.

>  
>    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?


>  #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.

Thanks,
Pedro Alves

  reply	other threads:[~2017-11-30 11:53 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 20:54 [RFC/RFA] Add support for the --readnever command-line option (DWARF only) Joel Brobecker
2016-07-12 14:27 ` Yao Qi
2016-10-04 18:07   ` Pedro Alves
2017-11-23  0:54     ` [PATCH v2] " Sergio Durigan Junior
2017-11-23 12:09       ` Pedro Alves
2017-11-23 17:21         ` Sergio Durigan Junior
2017-11-23 17:29           ` Pedro Alves
2017-11-24  4:54             ` Sergio Durigan Junior
2017-11-24 13:18               ` Pedro Alves
2017-11-24 20:27                 ` Sergio Durigan Junior
2017-11-27 19:13                   ` Pedro Alves
2017-11-29  0:59                     ` Sergio Durigan Junior
2017-11-29 12:23                       ` Pedro Alves
2017-11-23 15:59       ` Eli Zaretskii
2017-11-23 19:36         ` Sergio Durigan Junior
2016-10-04 18:06 ` [RFC/RFA] " Pedro Alves
2017-11-24 23:01 ` [PATCH v2] Add support for the --readnever command-line option Sergio Durigan Junior
2017-11-25  7:33   ` Eli Zaretskii
2017-11-25 16:41     ` Sergio Durigan Junior
2017-11-25 17:16       ` Eli Zaretskii
2017-11-29  1:21 ` [PATCH v3] Add support for the readnever concept Sergio Durigan Junior
2017-11-29  3:39   ` Eli Zaretskii
2017-11-29 12:25   ` Pedro Alves
2017-11-29 18:43     ` Sergio Durigan Junior
2017-11-29 21:45     ` [PATCH] Make 'symbol-file' not care about the position of command line arguments Sergio Durigan Junior
2017-11-29 22:26       ` Pedro Alves
2017-11-29 22:42         ` Sergio Durigan Junior
2017-11-29 23:15           ` Pedro Alves
2017-11-30  0:08             ` Sergio Durigan Junior
2017-11-30  0:34               ` Pedro Alves
2017-11-30  4:07                 ` Sergio Durigan Junior
2017-11-30  4:25       ` [PATCH v2] Make '{add-,}symbol-file' " Sergio Durigan Junior
2017-11-30 10:57         ` Pedro Alves
2017-11-30 12:38           ` Sergio Durigan Junior
2017-11-30 12:49             ` Pedro Alves
2017-11-30 13:06               ` Sergio Durigan Junior
2017-11-30 13:33       ` [PATCH v3] " Sergio Durigan Junior
2017-11-30 15:01         ` Pedro Alves
2017-11-30 17:26           ` Sergio Durigan Junior
2017-11-30 17:37             ` Pedro Alves
2017-11-30 17:43               ` Sergio Durigan Junior
2017-11-30 17:50                 ` Pedro Alves
2017-11-30 20:00       ` [PATCH v4] " Sergio Durigan Junior
2017-12-01 12:11         ` Pedro Alves
2017-12-01 17:41           ` Sergio Durigan Junior
2017-12-01 21:45             ` Pedro Alves
2017-12-01 22:02               ` Sergio Durigan Junior
2017-11-30  0:25 ` [PATCH v4] Add support for the readnever concept Sergio Durigan Junior
2017-11-30 11:53   ` Pedro Alves [this message]
2017-12-01  4:35     ` Sergio Durigan Junior
2017-12-01 12:43       ` Pedro Alves
2017-12-01 17:19         ` Tom Tromey
2017-12-01 17:21           ` Sergio Durigan Junior
2017-12-01 20:00             ` Pedro Alves
2017-12-01 22:16 ` [PATCH v5] " Sergio Durigan Junior
2017-12-01 23:19   ` Pedro Alves
2017-12-02  2:31     ` Sergio Durigan Junior
2017-12-02  8:21   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6765d36f-8603-9cd3-0476-801a5bfe0865@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=sergiodj@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).