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))
   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.
This commit is contained in:
Andrew Burgess 2013-11-26 16:21:53 +00:00 committed by Pedro Alves
parent 4920638856
commit 4f14910fa1
2 changed files with 5 additions and 1 deletions

View 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

View 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;
}