From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99467 invoked by alias); 3 Dec 2015 13:10:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 99447 invoked by uid 89); 3 Dec 2015 13:10:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 03 Dec 2015 13:10:25 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 074818F500; Thu, 3 Dec 2015 13:10:24 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB3DAM14008464; Thu, 3 Dec 2015 08:10:23 -0500 Message-ID: <56603F3E.6040703@redhat.com> Date: Thu, 03 Dec 2015 13:10:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Run gdb.base/sizeof.exp with board having gdb,noinferiorio References: <1448977402-9487-1-git-send-email-yao.qi@linaro.org> In-Reply-To: <1448977402-9487-1-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-12/txt/msg00045.txt.bz2 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