From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: cagney@gnu.org
Cc: gdb-patches@sources.redhat.com
Subject: Re: [commit] Tighten memory read/write methods
Date: Thu, 27 Jan 2005 21:05:00 -0000 [thread overview]
Message-ID: <200501272104.j0RL4pfb001823@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <41F94AE7.4020405@gnu.org> (message from Andrew Cagney on Thu, 27 Jan 2005 15:11:19 -0500)
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
prev parent reply other threads:[~2005-01-27 21:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-27 20:11 Andrew Cagney
2005-01-27 21:04 ` Mark Kettenis
2005-01-27 23:06 ` Andrew Cagney
2005-01-28 8:46 ` Mark Kettenis
2005-01-28 11:43 ` Eli Zaretskii
2005-01-28 18:48 ` Andrew Cagney
2005-01-28 20:21 ` Mark Kettenis
2005-01-29 10:33 ` Eli Zaretskii
2005-01-27 21:05 ` Mark Kettenis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200501272104.j0RL4pfb001823@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox