vla: resolve dynamic bounds if value contents is a constant byte-sequence
authorSanimir Agovic <sanimir.agovic@intel.com>
Tue, 26 Nov 2013 14:35:43 +0000 (14:35 +0000)
committerSanimir Agovic <sanimir.agovic@intel.com>
Fri, 11 Apr 2014 12:43:54 +0000 (13:43 +0100)
A variable location might be a constant value and therefore no inferior memory
access is needed to read the content. In this case try to resolve the type
bounds.

* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.

gdb/ChangeLog
gdb/findvar.c

index 4e32b712c9d9172a53ca65dcef0a41df0ab07061..137dba4ee01fc47e74d55cfc8d19421f2f38b456 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-11  Sanimir Agovic  <sanimir.agovic@intel.com>
+
+       * findvar.c (default_read_var_value): Resolve dynamic bounds if location
+       points to a constant blob.
+
 2014-04-11  Sanimir Agovic  <sanimir.agovic@intel.com>
 
        * dwarf2read.c (read_subrange_type): Convert DW_AT_count to a dynamic
index a2a7bb7d6d6becdf4525a399151cd26e5dc3188e..998a799e3bed6147ee61611a76735bfd22687dc7 100644 (file)
@@ -437,7 +437,12 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
   switch (SYMBOL_CLASS (var))
     {
     case LOC_CONST:
-      /* Put the constant back in target format.  */
+      if (is_dynamic_type (type))
+       {
+         /* Value is a constant byte-sequence and needs no memory access.  */
+         type = resolve_dynamic_type (type, /* Unused address.  */ 0);
+       }
+      /* Put the constant back in target format. */
       v = allocate_value (type);
       store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type),
                            gdbarch_byte_order (get_type_arch (type)),
@@ -464,6 +469,11 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
       return v;
 
     case LOC_CONST_BYTES:
+      if (is_dynamic_type (type))
+       {
+         /* Value is a constant byte-sequence and needs no memory access.  */
+         type = resolve_dynamic_type (type, /* Unused address.  */ 0);
+       }
       v = allocate_value (type);
       memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var),
              TYPE_LENGTH (type));
This page took 0.040566 seconds and 4 git commands to generate.