From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29193 invoked by alias); 23 Jun 2015 19:36: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 29150 invoked by uid 89); 23 Jun 2015 19:36:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 23 Jun 2015 19:36:20 +0000 Received: by obpn3 with SMTP id n3so13104411obp.0 for ; Tue, 23 Jun 2015 12:36:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=L8DEk6xAhpwg0KezDNYb+x56we/EXhu9UVDmotrB/2c=; b=D5jhqFUXbXJ+6cb28VGRu4qBrsMecbEXc2AgetxCGOzJCNYj7REWd7iacOFDKqjP6S yLBj7Ndsx1O+xIPh47wApYxSbJjKIq+0g0LjVDVpVBiEKjEHHSOOEawJb+54HsF6jvXT 8rnOr0KfmN/uXSKCZFFFtcJbK+3osBTwPt4pSC3E9vo8L/uSf+LFqs0RbmFhr6VufEbx VqlFtx/gLaVh0eNIidBLQPFxg2YGYWqWAAd1bRRNeHFRBat7HRSKVjloVU2ARwEBjx0a Z8EooRyiN2BvR4g0KF/8ojCNRJpoPyiBNDZWPHqb+B/0hDrhSnEmu0E4LN9cw+9UwhqA UIAA== X-Gm-Message-State: ALoCoQmztl6mzEDx/4+X2bM6Ga+DI03fQIc1/X+H8sX5FUEhUOlzDapuEFS5UtVuY+TORQk5WMUx X-Received: by 10.60.101.195 with SMTP id fi3mr31340773oeb.65.1435088179013; Tue, 23 Jun 2015 12:36:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Tue, 23 Jun 2015 12:35:59 -0700 (PDT) In-Reply-To: <5589952A.8010003@redhat.com> References: <1435069850-11830-1-git-send-email-patrick@parcs.ath.cx> <5589952A.8010003@redhat.com> From: Patrick Palka Date: Tue, 23 Jun 2015 19:36:00 -0000 Message-ID: Subject: Re: [PATCH] Fix GDBHISTSIZE test failure on i686 To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-06/txt/msg00502.txt.bz2 On Tue, Jun 23, 2015 at 1:19 PM, Pedro Alves wrote: > 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 Cool. I will commit the patch after confirming that it's fixed on i686 this way. > > Thanks, > Pedro Alves >