This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 03/12] Mark optimized out values as non-lazy.
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <aburgess at broadcom dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 26 Nov 2013 16:28:12 +0000
- Subject: Re: [PATCH 03/12] Mark optimized out values as non-lazy.
- Authentication-results: sourceware.org; auth=none
- References: <5208D1DF dot 1090201 at broadcom dot com> <5208D317 dot 2050502 at broadcom dot com>
On 08/12/2013 01:20 PM, Andrew Burgess wrote:
> This is a re-posting of this patch:
> The patch was never rejected, it just ran out of steam. Pedro noticed
> that we could go beyond this patch and do more, even releasing the
> value contents when we spot values are fully optimized out. I agree,
> but believe that is a separate idea, that can always be added later,
> for this case we've not even allocated any value contents yet.
> OK to apply?
OK. I've pushed it (with you as author), with the commit log
From: Andrew Burgess <firstname.lastname@example.org>
Mark entirely optimized out value as non-lazy.
If a value is entirely optimized out, then there's nothing for
value_fetch_lazy to fetch. Sequences like:
if (value_lazy (retval))
End up allocating the value contents buffer, wasting memory, for no
2013-11-26 Andrew Burgess <email@example.com>
* value.c (allocate_optimized_out_value): Mark value as non-lazy.
gdb/ChangeLog | 4 ++++
gdb/value.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7e28436..c144565 100644
@@ -1,3 +1,7 @@
+2013-11-26 Andrew Burgess <firstname.lastname@example.org>
+ * value.c (allocate_optimized_out_value): Mark value as non-lazy.
2013-11-26 Tom Tromey <email@example.com>
* dwarf2-frame.c (dwarf2_frame_cache): Revert patch from
diff --git a/gdb/value.c b/gdb/value.c
index da7778f..8052f52 100644
@@ -768,7 +768,7 @@ allocate_optimized_out_value (struct type *type)
struct value *retval = allocate_value_lazy (type);
set_value_optimized_out (retval, 1);
+ set_value_lazy (retval, 0);