[PATCH v9 21/29] record-btrace: provide xfer_partial target method

Metzger, Markus T markus.t.metzger@intel.com
Fri Dec 20 13:37:00 GMT 2013



> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Thursday, December 19, 2013 8:13 PM
> 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
> 
> On 12/19/2013 04:44 PM, Markus Metzger wrote:
> > +
> > +	    /* We do not allow writing memory in general.  */
> > +	    if (writebuf != NULL)
> > +	      throw_error (NOT_AVAILABLE_ERROR,
> > +			   _("This record target does not record memory."));
> 
> So printing globals errors out?
> 
> I thought you were going to return TARGET_XFER_E_UNAVAILABLE
> anyway?  Did you try making raw_memory_xfer_partial return
> immediately if ops->to_xfer_partial returns TARGET_XFER_E_UNAVAILABLE,
> instead of proceeding to query the target beneath?

I thought you were OK with the error.  Here's our discussion:

>>>> I now get an error when trying to access a variable with static storage
>>>> duration or when trying to access memory directly via its address.
>>>> It would be nice to also get an <unavailable> in those cases.  This would
>>>> require the respective layer to catch my exception.
>>>
>>> Please try returning TARGET_XFER_E_UNAVAILABLE instead.
>> 
>> That is ignored just like the -1 I returned earlier.  I nevertheless changed
>> the default return to that since it is more descriptive.
>
>Thanks.  Hmm, yes, looks like raw_memory_xfer_partial carries on
>looking at the target beneath, and then when that fails, we'll
>lose TARGET_XFER_E_UNAVAILABLE, and return TARGET_XFER_E_IO/-1,
>losing the better TARGET_XFER_E_UNAVAILABLE.

I can try to make raw_memorx_xfer_partial return on
TARGET_XFER_E_UNAVAILABLE.  This will be more intrusive, though.

Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052



More information about the Gdb-patches mailing list