From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15425 invoked by alias); 24 Jan 2002 18:52:39 -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 15361 invoked from network); 24 Jan 2002 18:52:33 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sources.redhat.com with SMTP; 24 Jan 2002 18:52:33 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id D421F3D8C; Thu, 24 Jan 2002 13:52:22 -0500 (EST) Message-ID: <3C5057E6.6070401@cygnus.com> Date: Thu, 24 Jan 2002 10:52:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: Michael Snyder Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] New option "trust-readonly-sections" References: <200201240323.g0O3NI905339@reddwarf.cygnus.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00730.txt.bz2 > *************** do_xfer_memory (CORE_ADDR memaddr, char > *** 857,862 **** > --- 859,883 ---- > 0. */ > errno = 0; > > + if (!write && trust_readonly) > + { > + /* User-settable option, "trust-readonly". If true, then > + memory from any SEC_READONLY bfd section may be read > + directly from the bfd file. */ > + > + struct section_table *secp; > + > + for (secp = current_target.to_sections; > + secp < current_target.to_sections_end; > + secp++) > + { > + /* FIXME: take it only if it's entirely within the section. */ > + if (memaddr >= secp->addr && memaddr + len <= secp->endaddr) > + return xfer_memory (memaddr, myaddr, len, 0, > + attrib, ¤t_target); My understanding of do_xfer_memory() is that it is allowed to do partial transfers. Hence, here, if the data doesn't all lie in the section, it is safe to truncate the transfer and return the number of bytes transfered. Andrew