Mirror of the gdb-patches mailing list
 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 v3] Add support for the readnever concept
Date: Wed, 29 Nov 2017 12:25:00 -0000	[thread overview]
Message-ID: <779a2d21-badf-b54c-e1c9-2f869716fd71@redhat.com> (raw)
In-Reply-To: <20171129012139.17325-1-sergiodj@redhat.com>

On 11/29/2017 01:21 AM, Sergio Durigan Junior wrote:
> Changes from v2:
> 
> - Fixed a few nits pointed by Eli in the docs.
> 
> - Implemented Pedro's suggestion and moved the logic of readnever out
>   of the "*_build_psymtabs" and into the elf_symfile_read function.

See my comments here:
  https://sourceware.org/ml/gdb-patches/2017-11/msg00766.html

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

Is this the same as:

 https://sourceware.org/ml/gdb-patches/2017-11/msg00656.html

?

Sounds like something that would be better split off to
a precursor patch.

> +++ b/gdb/testsuite/gdb.base/readnever.c
> @@ -0,0 +1,43 @@
> +/* Copyright 2016-2017 Free Software Foundation, Inc.
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 3 of the License, or
> +   (at your option) any later version.
> +
> +   This program is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> +
> +#include <stdio.h>

This include isn't necessary.

> +
> +static void
> +fun_three (int a, char b, void *c)
> +{
> +  /* Do nothing.  */
> +}
> +
> +static void
> +fun_two (unsigned int p, const char *y)
> +{
> +  fun_three ((int) p, '1', (void *) y);
> +}
> +
> +static void
> +fun_one (int *x)
> +{
> +  fun_two (10, (const char *) x);
> +}
> +
> +int
> +main (void)
> +{
> +  int a = 10;
> +
> +  fun_one (&a);
> +  return 0;
> +}

> +# Test invalid combination of flags.
> +save_vars { GDBFLAGS } {
> +    append GDBFLAGS " --readnever --readnow"
> +    gdb_exit
> +    gdb_spawn_ignore_error
> +
> +    set test "test readnow and readnever at the same time"
> +    gdb_test_multiple "" $test {
> +	eof {
> +	    pass $test
> +	}
> +    }

I had suggested to match GDB's error output before the eof,
so I'm surprised to see only eof expected?

> +}
> +

>  # Default gdb_spawn procedure.
>  
> -proc default_gdb_spawn { } {
> +proc default_gdb_spawn { { ignore_error 0 } } {
>      global use_gdb_stub
>      global GDB
>      global INTERNAL_GDBFLAGS GDBFLAGS
> @@ -1610,11 +1610,12 @@ proc default_gdb_spawn { } {
>  	}
>      }
>      set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"]
> -    if { $res < 0 || $res == "" } {
> -	perror "Spawning $GDB failed."
> -	return 1
> +    if { !$ignore_error } {
> +	if { $res < 0 || $res == "" } {
> +	    perror "Spawning $GDB failed."
> +	    return 1
> +	}
>      }

Hmm, I think I'm now confused on why this is needed in the first
place?  GDB-the-executable should be starting successfully, 
print some error output, and exit.  What error do you see
here, exactly?

> -
>      set gdb_spawn_id $res
>      return 0
>  }

Thanks,
Pedro Alves


  parent reply	other threads:[~2017-11-29 12:25 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 [this message]
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
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=779a2d21-badf-b54c-e1c9-2f869716fd71@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