From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44333 invoked by alias); 23 Jun 2015 17:19:43 -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 44320 invoked by uid 89); 23 Jun 2015 17:19:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Tue, 23 Jun 2015 17:19:41 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B0DCE8F232; Tue, 23 Jun 2015 17:19:40 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5NHJdA8029492; Tue, 23 Jun 2015 13:19:39 -0400 Message-ID: <5589952A.8010003@redhat.com> Date: Tue, 23 Jun 2015 17:19:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Patrick Palka , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix GDBHISTSIZE test failure on i686 References: <1435069850-11830-1-git-send-email-patrick@parcs.ath.cx> In-Reply-To: <1435069850-11830-1-git-send-email-patrick@parcs.ath.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-06/txt/msg00490.txt.bz2 On 06/23/2015 03:30 PM, Patrick Palka wrote: > The test > > test_histsize_history_setting "99999999999999999999999999999999999" "unlimited" > > was failing on i686 because the condition in init_history() for > determining whether to map a large GDBHISTSIZE value to infinity was > > long var = strtol (tmpenv); > if (var > INT_MAX) > history_size = unlimited; > > but this condition is never true on i686 because INT_MAX == LONG_MAX. > So in order to properly map large out-of-range values of GDBHISTSIZE to > infinity on targets where LONG_MAX > INT_MAX as well as on i686, we have > to instead change the above condition to > > if (var > INT_MAX > || (var == INT_MAX && errno == ERANGE)) > history_size = unlimited; > > [ I did not test this patch on i686 because I don't have access to > such a machine. But the patch seems straightforward enough... ] Looks fine to me, with the missing errno=0, but note that assuming you install the 32-bit dependencies in your distro, you can easily build a 32-bit gdb on a 64-bit host. E.g., on x86-64 GNU/Linux, configure with: CC="gcc -m32" /path/to/configure \ --host=i686-pc-linux-gnu \ --build=i686-pc-linux-gnu \ --target=i686-pc-linux-gnu Thanks, Pedro Alves