Blame SOURCES/gdb-rhbz1420304-s390x-20of35.patch

e1d87d
commit 840989c113433c069f54872d7e051e1572202326
e1d87d
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
e1d87d
Date:   Tue Jun 13 15:20:30 2017 +0200
e1d87d
e1d87d
    read/write_pieced_value: Drop 'buffer_size' variable
e1d87d
    
e1d87d
    When the variable 'buffer_size' in read_pieced_value and
e1d87d
    write_pieced_value was introduced, it was needed for tracking the buffer's
e1d87d
    allocated size.  Now that the buffer's data type has been changed to a
e1d87d
    std::vector, the variable is no longer necessary; so remove it.
e1d87d
    
e1d87d
    gdb/ChangeLog:
e1d87d
    
e1d87d
            * dwarf2loc.c (read_pieced_value): Remove buffer_size variable.
e1d87d
            (write_pieced_value): Likewise.
e1d87d
e1d87d
### a/gdb/ChangeLog
e1d87d
### b/gdb/ChangeLog
e1d87d
## -1,5 +1,10 @@
e1d87d
 2017-06-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>
e1d87d
 
e1d87d
+	* dwarf2loc.c (read_pieced_value): Remove buffer_size variable.
e1d87d
+	(write_pieced_value): Likewise.
e1d87d
+
e1d87d
+2017-06-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>
e1d87d
+
e1d87d
 	* dwarf2loc.c (write_pieced_value): When writing to a bit-field,
e1d87d
 	transfer the source value's least significant bits, instead of its
e1d87d
 	lowest-addressed ones.  Rename type_len to max_offset.
e1d87d
--- a/gdb/dwarf2loc.c
e1d87d
+++ b/gdb/dwarf2loc.c
e1d87d
@@ -1761,7 +1761,6 @@ read_pieced_value (struct value *v)
e1d87d
   gdb_byte *contents;
e1d87d
   struct piece_closure *c
e1d87d
     = (struct piece_closure *) value_computed_closure (v);
e1d87d
-  size_t buffer_size = 0;
e1d87d
   std::vector<gdb_byte> buffer;
e1d87d
   int bits_big_endian
e1d87d
     = gdbarch_bits_big_endian (get_type_arch (value_type (v)));
e1d87d
@@ -1806,12 +1805,8 @@ read_pieced_value (struct value *v)
e1d87d
 	this_size_bits = max_offset - offset;
e1d87d
 
e1d87d
       this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8;
e1d87d
+      buffer.reserve (this_size);
e1d87d
       source_offset = source_offset_bits / 8;
e1d87d
-      if (buffer_size < this_size)
e1d87d
-	{
e1d87d
-	  buffer_size = this_size;
e1d87d
-	  buffer.reserve (buffer_size);
e1d87d
-	}
e1d87d
       intermediate_buffer = buffer.data ();
e1d87d
 
e1d87d
       /* Copy from the source to DEST_BUFFER.  */
e1d87d
@@ -1929,7 +1924,6 @@ write_pieced_value (struct value *to, struct value *from)
e1d87d
   const gdb_byte *contents;
e1d87d
   struct piece_closure *c
e1d87d
     = (struct piece_closure *) value_computed_closure (to);
e1d87d
-  size_t buffer_size = 0;
e1d87d
   std::vector<gdb_byte> buffer;
e1d87d
   int bits_big_endian
e1d87d
     = gdbarch_bits_big_endian (get_type_arch (value_type (to)));
e1d87d
@@ -1988,11 +1982,7 @@ write_pieced_value (struct value *to, struct value *from)
e1d87d
 	}
e1d87d
       else
e1d87d
 	{
e1d87d
-	  if (buffer_size < this_size)
e1d87d
-	    {
e1d87d
-	      buffer_size = this_size;
e1d87d
-	      buffer.reserve (buffer_size);
e1d87d
-	    }
e1d87d
+	  buffer.reserve (this_size);
e1d87d
 	  source_buffer = buffer.data ();
e1d87d
 	  need_bitwise = 1;
e1d87d
 	}