This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/3] cleanup: replace allocate_value and memcpy with value_from_contents
- From: Sanimir Agovic <sanimir dot agovic at intel dot com>
- To: gdb-patches at sourceware dot org
- Cc: keven dot boell at intel dot com
- Date: Wed, 28 Aug 2013 15:52:31 +0200
- Subject: [PATCH 1/3] cleanup: replace allocate_value and memcpy with value_from_contents
- Authentication-results: sourceware.org; auth=none
- References: <1377697953-6954-1-git-send-email-sanimir dot agovic at intel dot com>
Instead of allocate_value and memcpy use value_from_contents, the latter
does the same.
2013-08-28 Sanimir Agovic <sanimir.agovic@intel.com>
* value.c (value_from_contents_and_address): Replace allocate_value and
memcpy with value_from_contents.
Change-Id: I29597c097f451e888e3715a76659355d5e6e89d4
---
gdb/value.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/gdb/value.c b/gdb/value.c
index d96c07b..7370257 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3188,10 +3188,7 @@ value_from_contents_and_address (struct type *type,
if (valaddr == NULL)
v = allocate_value_lazy (type);
else
- {
- v = allocate_value (type);
- memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type));
- }
+ v = value_from_contents (type, valaddr);
set_value_address (v, address);
VALUE_LVAL (v) = lval_memory;
return v;
--
1.7.1.1