diff options
author | Sanimir Agovic <sanimir.agovic@intel.com> | 2013-11-26 14:35:43 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@adacore.com> | 2014-04-14 09:18:44 -0700 |
commit | 1612e0c0f973f3defdfb2e74b09ec93f3d819c79 (patch) | |
tree | 6b03a5437bba6e8533a90f6a2e8269bd939f17e4 /gdb/findvar.c | |
parent | c451ebe5dd0c38617c74e0b6f0d5ef3188c25d56 (diff) | |
download | gdb-1612e0c0f973f3defdfb2e74b09ec93f3d819c79.zip gdb-1612e0c0f973f3defdfb2e74b09ec93f3d819c79.tar.gz gdb-1612e0c0f973f3defdfb2e74b09ec93f3d819c79.tar.bz2 |
vla: resolve dynamic bounds if value contents is a constant byte-sequence
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.
gdb/ChangeLog:
* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r-- | gdb/findvar.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c index a2a7bb7..998a799 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -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)); |