Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Run gdb.base/sizeof.exp with board having gdb,noinferiorio
Date: Thu, 03 Dec 2015 13:10:00 -0000	[thread overview]
Message-ID: <56603F3E.6040703@redhat.com> (raw)
In-Reply-To: <1448977402-9487-1-git-send-email-yao.qi@linaro.org>

On 12/01/2015 01:43 PM, Yao Qi wrote:
> In my remote cross testing (x86_64 host and aarch64 target), the test
> gdb.base/sizeof.exp is skipped because gdb,noinferiorio is defined in
> my gdbserver board file.  Tests are skipped because the test checks
> the expected value from the program's output, but I don't see why must
> do it this way.  With my patch applied, we can save the result in variable
> in the program, and check the variable then.  Then, the test doesn't rely
> on inferiorio.  However, in check_valueof, the value is still checked by
> printing from the program, because I don't know why do we test in this
> way, so I leave them there.

We're checking whether gdb [1] and the compiler agree on the signness of "char":

These casts are evaluated by gdb:

  set signof_char [get_integer_valueof "(int) (char) -1" -1]

While these are evaluated by the compiler:

  printf ("valueof ((int) (char) -1) == %d\n", (int) (char) -1);

If char is unsigned, that prints 0xff; if char is signed, it prints -1.

I think we can replace that like you did for sizeof.

  value = (int) (char) -1;

etc., and then check "p value = ${val}", just like you did for
the sizeof checks.

[1] - This is gdbarch_char_signed.

Thanks,
Pedro Alves


  reply	other threads:[~2015-12-03 13:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 13:43 Yao Qi
2015-12-03 13:10 ` Pedro Alves [this message]
2015-12-03 15:49   ` Yao Qi
2015-12-03 15:50     ` Pedro Alves
2015-12-03 17:13       ` Yao Qi

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=56603F3E.6040703@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.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