This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [commit] Tighten memory read/write methods
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: cagney at gnu dot org
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 27 Jan 2005 22:04:51 +0100 (CET)
- Subject: Re: [commit] Tighten memory read/write methods
- References: <41F94AE7.4020405@gnu.org>
Date: Thu, 27 Jan 2005 15:11:19 -0500
From: Andrew Cagney <cagney@gnu.org>
Index: corefile.c
===================================================================
RCS file: /cvs/src/src/gdb/corefile.c,v
retrieving revision 1.28
diff -p -u -r1.28 corefile.c
--- corefile.c 13 Jan 2005 23:56:25 -0000 1.28
+++ corefile.c 27 Jan 2005 20:07:21 -0000
@@ -347,11 +347,13 @@ read_memory_typed_address (CORE_ADDR add
/* Same as target_write_memory, but report an error if can't write. */
void
-write_memory (CORE_ADDR memaddr, char *myaddr, int len)
+write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, int len)
{
int status;
-
- status = target_write_memory (memaddr, myaddr, len);
+ bfd_byte *bytes = alloca (len);
+
+ memcpy (bytes, myaddr, len);
+ status = target_write_memory (memaddr, bytes, len);
if (status != 0)
memory_error (status, memaddr);
}
Is this addiotional copy really necessary now that you've properly
consified target_write_memory?
Mark