From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102513 invoked by alias); 13 May 2015 22:38:42 -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 102462 invoked by uid 89); 13 May 2015 22:38:42 -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,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-ob0-f180.google.com Received: from mail-ob0-f180.google.com (HELO mail-ob0-f180.google.com) (209.85.214.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 13 May 2015 22:38:41 +0000 Received: by obcus9 with SMTP id us9so40935003obc.2 for ; Wed, 13 May 2015 15:38:39 -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=D4MhTXJ3WYMBu3Py/dzwD6b0PefSOBI57CzkFH/2N1w=; b=gMqf2r2z8UeFfejAEpEFIhfwHMTlNUeihoZOkTfFnKJlhC5QvAgdMM0FnDK1daDU8S lGiEO3VXgQ4L99/0vOaS/guZ/VwHOl1+M/SsnKCYImMQd+SxptGhAxdytj+lcNrSpHWD pAj9Oaq/o7Q1hbk+xZG47mhr6KRVrEMEk9v/tLQhce8iK7RyK+2OsvOaANKTt+G9o7df ZO5VASsycCvoc0eZrAOoWwF7gqys0g7riFu4XegNPk53PDA2V0L6nl6e1k074vDLowVQ 79cBMtvPG7dVvF0wDTSp1FX30zJFeC/KA9xIX/2x3TasZ89CEiARwg+e2sLhuFCwVhAV XGgw== X-Gm-Message-State: ALoCoQmt1giLJKpcV2n9TfwP0FRjKkWkaQBpG2DtTdTA9A8YB6iZgh4dKMdApVWbbVF21/DXAZIJ X-Received: by 10.202.49.11 with SMTP id x11mr909694oix.63.1431556719186; Wed, 13 May 2015 15:38:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.243.232 with HTTP; Wed, 13 May 2015 15:38:18 -0700 (PDT) In-Reply-To: <201505132224.t4DMOLg0002690@glazunov.sibelius.xs4all.nl> References: <1431555450-15493-1-git-send-email-patrick@parcs.ath.cx> <201505132224.t4DMOLg0002690@glazunov.sibelius.xs4all.nl> From: Patrick Palka Date: Wed, 13 May 2015 22:38:00 -0000 Message-ID: Subject: Re: [PATCH] Fix PR gdb/16999 To: Mark Kettenis Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-05/txt/msg00351.txt.bz2 On Wed, May 13, 2015 at 6:24 PM, Mark Kettenis wrote: >> >> When GDB reads a nonsensical value for the HISTSIZE environment variable >> variable, i.e. one that is non-numeric or negative, GDB then sets its >> history size to 0. This behavior is contrary to that of bash, which >> defaults the history size to unlimited in such cases. >> >> This patch makes the behavior of invalid HISTSIZE match that of bash. >> When we encounter an invalid HISTSIZE we now set the history size to >> unlimited instead of 0. > > The GDB behaviour makes more sense to me especially in light of: > >> - /* Prefer ending up with no history rather than overflowing >> - readline's history interface, which uses signed 'int' >> - everywhere. */ We won't overflow readline's history interface with or without the patch. The setting of our history size to -1 instructs set_readline_history_size() to call unstifle_history() instead of stifle_history(size). I personally don't like GDB's behavior because 1) it's not consistent with bash and 2) it's unforgiving: a mere typo when setting HISTSIZE will truncate the entire history file at exit. Another possibility is to not touch the history size at all when HISTSIZE is invalid. That makes the most sense to me but then the inconsistency with bash still remains. Dunno what's better..