This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Run gdb.base/sizeof.exp with board having gdb,noinferiorio
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 03 Dec 2015 13:10:22 +0000
- Subject: Re: [PATCH] Run gdb.base/sizeof.exp with board having gdb,noinferiorio
- Authentication-results: sourceware.org; auth=none
- References: <1448977402-9487-1-git-send-email-yao dot qi at linaro dot 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