public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb: add set/show commands for managing debuginfod
Date: Fri, 29 Oct 2021 21:09:38 -0400	[thread overview]
Message-ID: <CAJDtP-TvZ4c32QkE0a-Q5t-x2GDacE2w81gvwekq4iUbUhnS7Q@mail.gmail.com> (raw)
In-Reply-To: <6137615d-9b33-8e24-4d81-5aa998d7fc1b@polymtl.ca>

Hi Simon,

On Thu, Oct 28, 2021 at 9:47 PM Simon Marchi <simon.marchi@polymtl.ca> wrote:
> Thanks for the update.  I have a few minor comments, the patch is OK to
> push with that fixed.

Pushed as commit 7811fa5995fc.

> >   This GDB supports auto-downloading debuginfo from the following URLs:
> >   <URL1> <URL2> ...
> >   Enable debuginfod? (y or [n]) y
> >   Debuginfod has been enabled.
> >   To make this setting permanent, add 'set debuginfod on' to .gdbinit.
>
> I just thought that it would be nice to say "Enable debuginfod for this
> session?", just to make it clear that it's for the duration of the
> session.

Fixed.

> > +static void
> > +set_debuginfod_verbose_command (const char *args, int from_tty,
> > +                           struct cmd_list_element *c)
>
> The last line is missing two columns of indent, and the function below
> too.

Fixed.

> > +  /* set debuginfod */
> > +  add_basic_prefix_cmd ("debuginfod", class_run,
> > +                     _("Set debuginfod options"),
> > +                     &set_debuginfod_prefix_list,
> > +                     false, &setlist);
> > +
> > +  /* show debuginfod */
> > +  add_prefix_cmd ("debuginfod", class_run,
> > +               show_debuginfod_command,
> > +               _("Show debuginfod options"),
> > +               &show_debuginfod_prefix_list,
> > +               false, &showlist);
>
> I just merged a patch that adds the add_setshow_prefix_cmd function,
> that does the equivalent of the two function calls above.  Could you
> convert your code to use it?

Changed to use add_setshow_prefix_cmd. Because this function
doesn't have a parameter for a custom show function I added
a 'show debuginfod status' command so that the user can check
whether debuginfod is set to 'on', 'off' or 'ask'.

> Is it clear to the user that $DEBUGINFOD_URLS refers to the environment
> variable?  Perhaps say "from the DEBUGINFOD_URLS environment
> variable".

Fixed.

> > +  /* set/show debuginfod verbose */
> > +  add_setshow_zuinteger_cmd ("verbose", class_support,
> > +                          &debuginfod_verbose, _("\
> > +Set verbosity of debuginfod output."), _("\
> > +Show debuginfod debugging."), _("\
> > +When set to a non-zero value, display verbose output for each debuginfod \
> > +query.\nTo disable, set to zero.  Verbose output is displayed by default."),
> > +                          set_debuginfod_verbose_command,
> > +                          show_debuginfod_verbose_command,
> > +                          &set_debuginfod_prefix_list,
> > +                          &show_debuginfod_prefix_list);
>
> Just wondering, is it your intent to use an integer here, to allow for
> possibly more than one level of verbosity?  If so, then it's ok.  If
> not, then it would make more sense to use a bool.

I kept it as an integer so that if we decide to add additional levels of
verbosity in the future then we won't have to change the argument
from bool to int.

> It is happening even before this patch, but for some reason on my
> computer I get:
>
>
>     $ make check TESTS="gdb.debuginfod/fetch_src_and_symbols.exp"
>     make[1]: Entering directory '/home/simark/build/binutils-gdb/gdb/testsuite'
>     make check-single
>     make[2]: Entering directory '/home/simark/build/binutils-gdb/gdb/testsuite'
>     rootme=`pwd`; export rootme; srcdir=/home/simark/src/binutils-gdb/gdb/testsuite ; export srcdir ; EXPECT=`if [ "${READ1}" != "" ] ; then echo ${rootme}/expect-read1; elif [ "${READMORE}" != "" ] ; then echo ${rootme}/expect-readmore; elif [ -f ${rootme}/../../expect/expect ] ; then echo ${rootme}/../../expect/expect ; else echo expect ; fi` ; export EXPECT ; EXEEXT= ; export EXEEXT ;    LD_LIBRARY_PATH=$rootme/../../expect:$rootme/../../libstdc++:$rootme/../../tk/unix:$rootme/../../tcl/unix:$rootme/../../bfd:$rootme/../../opcodes:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; if [ -f ${rootme}/../../expect/expect ] ; then TCL_LIBRARY=${srcdir}/../../tcl/library ; export TCL_LIBRARY ; fi ; runtest --status  gdb.debuginfod/fetch_src_and_symbols.exp
>     WARNING: Couldn't find the global config file.
>     Using /home/simark/src/binutils-gdb/gdb/testsuite/lib/gdb.exp as tool init file.
>     NOTE: Dejagnu's default_target_compile is missing support for Go, using local override
>     NOTE: Dejagnu's default_target_compile is missing support for Rust, using local override
>     Test run by simark on Thu Oct 28 21:43:37 2021
>     Native configuration is x86_64-pc-linux-gnu
>
>                     === gdb tests ===
>
>     Schedule of variations:
>         unix
>
>     Running target unix
>     Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
>     Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
>     Using /home/simark/src/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
>     Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp ...
>     ERROR: tcl error sourcing /home/simark/src/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp.
>     ERROR: This GDB was configured as follows:
>        configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
>                  --with-auto-load-dir=$debugdir:$datadir/auto-load
>                  --with-auto-load-safe-path=$debugdir:$datadir/auto-load
>                  --with-expat
>                  --with-gdb-datadir=/usr/local/share/gdb (relocatable)
>                  --with-jit-reader-dir=/usr/local/lib/gdb (relocatable)
>                  --without-libunwind-ia64
>                  --with-lzma
>                  --with-babeltrace
>                  --with-intel-pt
>                  --with-mpfr
>                  --with-xxhash
>                  --with-python=/usr
>                  --with-python-libdir=/tmp/foo
>                  --with-debuginfod
>                  --with-guile
>                  --enable-source-highlight
>                  --with-separate-debug-dir=/usr/local/lib/debug (relocatable)
>
>     ("Relocatable" means the directory can be moved with the GDB installation
>     tree, and GDB will still find it.)
>
> I'll have to investigate that later.

I have not seen this on my Fedora 33 x86_64 machine.

Thanks,
Aaron


  reply	other threads:[~2021-10-30  1:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 23:01 [PATCH 0/2 v3] gdb: Add debuginfod first-use notification Aaron Merey
2021-10-18 23:01 ` [PATCH 1/2] gdb: add set/show commands for managing debuginfod Aaron Merey
2021-10-20 20:34   ` Keith Seitz
2021-10-21 22:23     ` Lancelot SIX
2021-10-25 22:30       ` Aaron Merey
2021-10-21 22:02   ` Lancelot SIX
2021-10-26 16:08   ` Simon Marchi
2021-10-28 22:18     ` Aaron Merey
2021-10-29  1:47       ` Simon Marchi
2021-10-30  1:09         ` Aaron Merey [this message]
2021-10-30  1:54           ` Simon Marchi
2021-10-31  2:43             ` Simon Marchi
2021-11-01 15:52               ` Simon Marchi
2021-11-01 17:39                 ` Aaron Merey
2021-11-01 18:00                   ` Simon Marchi
2021-11-02 16:51                     ` Simon Marchi
2021-11-02 20:35                       ` Aaron Merey
2021-10-18 23:01 ` [PATCH 2/2] gdb.texinfo: Expand documentation for debuginfod Aaron Merey
2021-10-19 11:17   ` Eli Zaretskii
2021-10-19 22:35     ` Aaron Merey
2021-10-20 11:38       ` Eli Zaretskii
2021-10-30  1:18         ` Aaron Merey
2021-10-30  6:57           ` Tom de Vries

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=CAJDtP-TvZ4c32QkE0a-Q5t-x2GDacE2w81gvwekq4iUbUhnS7Q@mail.gmail.com \
    --to=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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).