From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114647 invoked by alias); 3 Jul 2015 18:04:31 -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 114635 invoked by uid 89); 3 Jul 2015 18:04:30 -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,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 03 Jul 2015 18:04:28 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 33.CA.07675.69766955; Fri, 3 Jul 2015 12:44:38 +0200 (CEST) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.87) with Microsoft SMTP Server (TLS) id 14.3.210.2; Fri, 3 Jul 2015 14:04:25 -0400 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Cleanup value_fetch_lazy's comment and return value Date: Fri, 03 Jul 2015 18:04:00 -0000 Message-ID: <1435946662-31310-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00102.txt.bz2 The comment for value_fetch_lazy seems outdated. It says that it's only called from the value_contents and value_contents_all (macros!), which is not true. Also, the return value seems useless now, despite what the comment says. gdb/ChangeLog: * value.c (value_fetch_lazy): Update comment, change return value to void. * value.h (value_fetch_lazy): Change return value to void. --- gdb/value.c | 17 +++++------------ gdb/value.h | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/gdb/value.c b/gdb/value.c index 86d7d00..a01f390 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3781,21 +3781,15 @@ value_initialized (struct value *val) return val->initialized; } -/* Called only from the value_contents and value_contents_all() - macros, if the current data for a variable needs to be loaded into - value_contents(VAL). Fetches the data from the user's process, and - clears the lazy flag to indicate that the data in the buffer is - valid. +/* Load the actual content of a lazy value. Fetch the data from the + user's process and clear the lazy flag to indicate that the data in + the buffer is valid. If the value is zero-length, we avoid calling read_memory, which would abort. We mark the value as fetched anyway -- all 0 bytes of - it. + it. */ - This function returns a value because it is used in the - value_contents macro as part of an expression, where a void would - not work. The value is ignored. */ - -int +void value_fetch_lazy (struct value *val) { gdb_assert (value_lazy (val)); @@ -3947,7 +3941,6 @@ value_fetch_lazy (struct value *val) internal_error (__FILE__, __LINE__, _("Unexpected lazy value type.")); set_value_lazy (val, 0); - return 0; } /* Implementation of the convenience function $_isvoid. */ diff --git a/gdb/value.h b/gdb/value.h index 957bcd4..7ff6aa8 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -361,7 +361,7 @@ extern const gdb_byte *value_contents_for_printing (struct value *value); extern const gdb_byte * value_contents_for_printing_const (const struct value *value); -extern int value_fetch_lazy (struct value *val); +extern void value_fetch_lazy (struct value *val); /* If nonzero, this is the value of a variable which does not actually exist in the program, at least partially. If the value is lazy, -- 2.1.4