public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Patrick Palka <patrick@parcs.ath.cx>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix GDBHISTSIZE test failure on i686
Date: Tue, 23 Jun 2015 17:19:00 -0000	[thread overview]
Message-ID: <5589952A.8010003@redhat.com> (raw)
In-Reply-To: <1435069850-11830-1-git-send-email-patrick@parcs.ath.cx>

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

  parent reply	other threads:[~2015-06-23 17:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 14:31 Patrick Palka
2015-06-23 14:46 ` Patrick Palka
2015-06-23 17:19 ` Pedro Alves [this message]
2015-06-23 17:42   ` Doug Evans
2015-06-23 19:36   ` Patrick Palka

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=5589952A.8010003@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=patrick@parcs.ath.cx \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).