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>
Cc: GDB Patches <gdb-patches@sourceware.org>,
	Eli Zaretskii <eliz@gnu.org>,        Doug Evans <dje@google.com>,
	Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH v2] Add convenience variable $_exitsignal
Date: Wed, 19 Jun 2013 10:56:00 -0000	[thread overview]
Message-ID: <51C18A92.7030109@redhat.com> (raw)
In-Reply-To: <m3ehbzqmsn.fsf@redhat.com>

On 06/18/2013 07:46 PM, Sergio Durigan Junior wrote:
> Hi,
>
> This is the second version of the patch which adds the convenience
> variable "$_exitsignal".  You can look at the first version here:
>
> <http://sourceware.org/ml/gdb-patches/2013-06/msg00352.html>
>
> I have made the proposed modifications suggested by Eli, Doug and
> Pedro.
>
> Doug, please take a look at tell me what you think.  Eli, I have
> rewritten the doc entry for $_exitcode in order to make it explain which
> variable is set and which is cleared depending on the situation.  And
> Pedro, I've made the test more complete.

Thanks.

> OK to apply?

Hmm.  This is still exposing the GDB signal numbers instead of the target's?

> diff --git a/gdb/testsuite/gdb.base/exitsignal.c b/gdb/testsuite/gdb.base/exitsignal.c
> new file mode 100644
> index 0000000..d2b479b
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/exitsignal.c
> @@ -0,0 +1,37 @@

...

> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +*/

Spurious empty line.

> +
> +/* This test can be used just to generate a SIGSEGV.  */
> +
> +#include <stdio.h>

This include looks unnecessary.

> +
> +int
> +main (int argc, char *argv[])
> +{
> +  char *p = NULL;
> +
> +#ifdef GENSEGV
> +  /* Generating a SIGSEGV.  */
> +  *p = 1;
> +#else
> +  /* Just do a normal return.  */
> +  (void) p;
> +  return 0;
> +#endif
> +}

The amount of shared code between GENSEGV and !GENSEGV is
so little (just boilerplate), that I'd suggest just splitting
them into two files.  Then the "This test can be used just
to generate a SIGSEGV" comment at the top wouldn't be
incorrect.  :-)

> +
> +# Now we test the behaviour of $_exit{code,signal} during a normal
> +# inferior execution.
> +gdb_rename_execfile $binfile ${binfile}x

Please don't rename like this.  Instead generate distinct executables
from the get go.  See e.g., gdb.multi/multi-arch.exp.

> +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
> +    return -1
> +}

-- 
Pedro Alves


  parent reply	other threads:[~2013-06-19 10:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 18:55 Sergio Durigan Junior
2013-06-18 19:02 ` Eli Zaretskii
2013-06-18 19:07   ` Sergio Durigan Junior
2013-06-18 19:16     ` Eli Zaretskii
2013-06-18 19:44       ` Sergio Durigan Junior
2013-06-19 10:56 ` Pedro Alves [this message]
2013-07-18 16:50 ` Tom Tromey

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=51C18A92.7030109@redhat.com \
    --to=palves@redhat.com \
    --cc=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --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