* [PATCH] Cleanup value_fetch_lazy's comment and return value
@ 2015-07-03 18:04 Simon Marchi
2015-07-03 18:24 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2015-07-03 18:04 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Cleanup value_fetch_lazy's comment and return value
2015-07-03 18:04 [PATCH] Cleanup value_fetch_lazy's comment and return value Simon Marchi
@ 2015-07-03 18:24 ` Pedro Alves
2015-07-06 17:09 ` Simon Marchi
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2015-07-03 18:24 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 07/03/2015 07:04 PM, Simon Marchi wrote:
> 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.
OK.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Cleanup value_fetch_lazy's comment and return value
2015-07-03 18:24 ` Pedro Alves
@ 2015-07-06 17:09 ` Simon Marchi
0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2015-07-06 17:09 UTC (permalink / raw)
To: Pedro Alves, gdb-patches
On 15-07-03 02:24 PM, Pedro Alves wrote:
> On 07/03/2015 07:04 PM, Simon Marchi wrote:
>> 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.
>
> OK.
>
> Thanks,
> Pedro Alves
Thanks, pushed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-06 17:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-03 18:04 [PATCH] Cleanup value_fetch_lazy's comment and return value Simon Marchi
2015-07-03 18:24 ` Pedro Alves
2015-07-06 17:09 ` Simon Marchi
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).