From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22819 invoked by alias); 21 Feb 2014 01:28:35 -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 22808 invoked by uid 89); 21 Feb 2014 01:28:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f201.google.com Received: from mail-pd0-f201.google.com (HELO mail-pd0-f201.google.com) (209.85.192.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 21 Feb 2014 01:28:33 +0000 Received: by mail-pd0-f201.google.com with SMTP id fp1so433454pdb.4 for ; Thu, 20 Feb 2014 17:28:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=OFCw0XwVaEpjQtVUd4e4OBdMddltDmYaP68l+w+Gwfo=; b=BS6Qp8/NuTRYUbeWNObliRNU8sAIKIrl2DYGCOmggFnTodN14RyWGxXMkX/sqTs0Df OJ9krr8ON6vjkDB8VlZ2jADOt5f797GZ+Koz+ByUMsiY6OHQPtmScsZvhFp5yMWwB5xo yHY0lqt9+zj5zHHMGTBdtTr2lrBiGCow2qGXIK22sdqJwpuoVKcSz+w7NgRvJgvR1HLO O7dt4/vkB8lJSG1zy2ExRaIBTkXgKNEvCMFYaYqTHZuOANPrfgPJ2y75mGH0yuB/UBG0 4dL3iTJ6sT9wpI+vlM7ipq7NMdcP1Ki4kkBlhnvrjyLERPwkO+GTT8MG0pLflnh8bKtn HhwQ== X-Gm-Message-State: ALoCoQk4PWmMnSs8j9DPe9K75mywNLplCnqDpugYWKZKeNJQNpVUQyIHM15xHCxobfp4Xx4uUAlVZYZuVTsVOnI9T+PHEVY9zlK95aKEiSs6iruiFaBzmJ5cendhu9PWKkC1c0Hhbwt050sF9Zdojd7QWityQ+sv5vecMpA/QbLYIj89W0R3imll+I6Xd7LyJpK5gcGGMaBG02lhcFExysyW2bc5+cLV0w== X-Received: by 10.66.158.6 with SMTP id wq6mr2228304pab.39.1392946110390; Thu, 20 Feb 2014 17:28:30 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id x29si428750yha.0.2014.02.20.17.28.30 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Feb 2014 17:28:30 -0800 (PST) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id A70485A428D; Thu, 20 Feb 2014 17:28:29 -0800 (PST) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21254.43965.134829.97097@ruffy.mtv.corp.google.com> Date: Fri, 21 Feb 2014 01:28:00 -0000 To: gdb-patches@sourceware.org Cc: ludo@gnu.org, eliz@gnu.org Subject: Re: [PATCH] value.c (record_latest_value): Fix comment. In-Reply-To: References: X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00677.txt.bz2 Doug Evans writes: > Hi. > > This patch fixes a comment that was found to be wrong in this thread: > > https://sourceware.org/ml/gdb-patches/2014-02/msg00674.html > > I checked as far back as 6.1.1, and it's never returned -1. > [I could go back further, but I don't see the point.] > > 2014-02-20 Doug Evans > > * value.c (record_latest_value): Fix comment. Hmmm, even part of gdb still thinks record_latest_value can return -1. 2014-02-20 Doug Evans * value.c (record_latest_value): Fix comment. * printcmd.c (print_command_1): Remove code to handle -1 return from record_latest_value. diff --git a/gdb/value.c b/gdb/value.c index 73ba18e..50b0245 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1642,9 +1642,7 @@ set_value_component_location (struct value *component, /* Access to the value history. */ /* Record a new value in the value history. - Returns the absolute history index of the entry. - Result of -1 indicates the value was not saved; otherwise it is the - value history index of this new item. */ + Returns the absolute history index of the entry. */ int record_latest_value (struct value *val) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 10d3c23..e5fea17 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -985,16 +985,11 @@ print_command_1 (const char *exp, int voidprint) struct value_print_options opts; int histindex = record_latest_value (val); - if (histindex >= 0) - annotate_value_history_begin (histindex, value_type (val)); - else - annotate_value_begin (value_type (val)); + annotate_value_history_begin (histindex, value_type (val)); - if (histindex >= 0) - printf_filtered ("$%d = ", histindex); + printf_filtered ("$%d = ", histindex); - if (histindex >= 0) - annotate_value_history_value (); + annotate_value_history_value (); get_formatted_print_options (&opts, format); opts.raw = fmt.raw; @@ -1002,10 +997,7 @@ print_command_1 (const char *exp, int voidprint) print_formatted (val, fmt.size, &opts, gdb_stdout); printf_filtered ("\n"); - if (histindex >= 0) - annotate_value_history_end (); - else - annotate_value_end (); + annotate_value_history_end (); } do_cleanups (old_chain);