From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19633 invoked by alias); 27 Jan 2005 21:05:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19547 invoked from network); 27 Jan 2005 21:04:53 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 27 Jan 2005 21:04:53 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j0RL4plG015435; Thu, 27 Jan 2005 22:04:51 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id j0RL4pV6001826; Thu, 27 Jan 2005 22:04:51 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id j0RL4pfb001823; Thu, 27 Jan 2005 22:04:51 +0100 (CET) Date: Thu, 27 Jan 2005 21:05:00 -0000 Message-Id: <200501272104.j0RL4pfb001823@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: cagney@gnu.org CC: gdb-patches@sources.redhat.com In-reply-to: <41F94AE7.4020405@gnu.org> (message from Andrew Cagney on Thu, 27 Jan 2005 15:11:19 -0500) Subject: Re: [commit] Tighten memory read/write methods References: <41F94AE7.4020405@gnu.org> X-SW-Source: 2005-01/txt/msg00265.txt.bz2 Date: Thu, 27 Jan 2005 15:11:19 -0500 From: Andrew Cagney 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