From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18871 invoked by alias); 20 Dec 2013 15:56:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18861 invoked by uid 89); 20 Dec 2013 15:56:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Dec 2013 15:56:02 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBKFu0Iw024866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 Dec 2013 10:56:00 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBKFtwP9011519; Fri, 20 Dec 2013 10:55:59 -0500 Message-ID: <52B4688E.2090603@redhat.com> Date: Fri, 20 Dec 2013 15:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: "Metzger, Markus T" CC: "jan.kratochvil@redhat.com" , "gdb-patches@sourceware.org" Subject: Re: [PATCH v9 21/29] record-btrace: provide xfer_partial target method References: <1387471499-29444-1-git-send-email-markus.t.metzger@intel.com> <1387471499-29444-22-git-send-email-markus.t.metzger@intel.com> <52B34555.8040200@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00840.txt.bz2 On 12/20/2013 01:54 PM, Metzger, Markus T wrote: >> -----Original Message----- >> From: Metzger, Markus T >> Sent: Friday, December 20, 2013 2:37 PM >> To: Pedro Alves > > >> I can try to make raw_memorx_xfer_partial return on >> TARGET_XFER_E_UNAVAILABLE. This will be more intrusive, though. > > I did not get any regressions on 64bit IA Linux native. > And the error message is definitely nicer. Can you show the patchlet you did, and the before/after gdb output though? I'd be better to see that, and have any possible follow up discussion discussion here now, rather than fractured to a potential repost of the series. BTW, I think that ... + /* Filter out requests that don't make sense during replay. */ + if (!record_btrace_allow_memory_access && record_btrace_is_replaying ()) + { + switch (object) + { + case TARGET_OBJECT_MEMORY: + case TARGET_OBJECT_RAW_MEMORY: + case TARGET_OBJECT_STACK_MEMORY: + { + struct target_section *section; + + /* We do not allow writing memory in general. */ + if (writebuf != NULL) + throw_error (NOT_AVAILABLE_ERROR, + _("This record target does not record memory.")); + + /* We allow reading readonly memory. */ + section = target_section_by_addr (ops, offset); + if (section != NULL) + { + /* Check if the section we found is readonly. */ + if ((bfd_get_section_flags (section->the_bfd_section->owner, + section->the_bfd_section) + & SEC_READONLY) != 0) + { + /* Truncate the request to fit into this section. */ + len = min (len, section->endaddr - offset); + break; ... here, this should return TARGET_XFER_E_IO rather than break and falling through to the code that defers to the target beneath, as the caller will already do that for memory transfers. + } + } + + throw_error (NOT_AVAILABLE_ERROR, + _("This record target does not record memory.")); Then here return TARGET_XFER_E_UNAVAILABLE. + } + } + } > Should we add a new '-3' return value to be on the safe side? > I.e. raw_memory_xfer_partial would bail out on -3 and keep > going for -1 and -2. I'm not seeing why we'd need that. TARGET_XFER_E_UNAVAILABLE is exactly designed for this use case. It's just that it was added recently, and we hadn't found a use outside tracing yet. -- Pedro Alves