Mark entirely optimized out value as non-lazy.
authorAndrew Burgess <aburgess@broadcom.com>
Tue, 26 Nov 2013 16:21:53 +0000 (16:21 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 26 Nov 2013 16:21:53 +0000 (16:21 +0000)
If a value is entirely optimized out, then there's nothing for
value_fetch_lazy to fetch.  Sequences like:

 if (value_lazy (retval))
   value_fetch_lazy (retval);

End up allocating the value contents buffer, wasting memory, for no
use.

gdb/ChangeLog
2013-11-26  Andrew Burgess  <aburgess@broadcom.com>

* value.c (allocate_optimized_out_value): Mark value as non-lazy.

gdb/ChangeLog
gdb/value.c

index 7e284361a77f184538419594722e2005c007e582..c144565da2e3279d792182f9fec9043c98e6c0e9 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-26  Andrew Burgess  <aburgess@broadcom.com>
+
+       * value.c (allocate_optimized_out_value): Mark value as non-lazy.
+
 2013-11-26  Tom Tromey  <tromey@redhat.com>
 
        * dwarf2-frame.c (dwarf2_frame_cache): Revert patch from
index da7778f01927dc5bdbbc73aa496e0a274df6211f..8052f52f874689aa07a6a54fb94a51bfc9f856c0 100644 (file)
@@ -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);
   return retval;
 }