This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v3 08/13] vla: resolve dynamic bounds if value contents is a constant byte-sequence
- From: Sanimir Agovic <sanimir dot agovic at intel dot com>
- To: tromey at redhat dot com, palves at redhat dot com, xdje42 at gmail dot com
- Cc: gdb-patches at sourceware dot org, keven dot boell at intel dot com
- Date: Wed, 4 Dec 2013 15:19:40 +0100
- Subject: [PATCH v3 08/13] vla: resolve dynamic bounds if value contents is a constant byte-sequence
- Authentication-results: sourceware.org; auth=none
- References: <1386166785-28037-1-git-send-email-sanimir dot agovic at intel dot com>
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.
2013-11-26 Sanimir Agovic <sanimir.agovic@intel.com>
Keven Boell <keven.boell@intel.com>
* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.
Change-Id: I73c31b64976b7d2c603c68d4584909502c8c5928
Signed-off-by: Sanimir Agovic <sanimir.agovic@intel.com>
---
gdb/findvar.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/findvar.c b/gdb/findvar.c
index ec6afd6..a543dc4 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -468,6 +468,9 @@ 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));
--
1.8.3.1