This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v8 17/24] record-btrace: provide xfer_partial target method
- From: Pedro Alves <palves at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "jan dot kratochvil at redhat dot com" <jan dot kratochvil at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 16 Dec 2013 19:16:24 +0000
- Subject: Re: [patch v8 17/24] record-btrace: provide xfer_partial target method
- Authentication-results: sourceware.org; auth=none
- References: <1386839747-8860-1-git-send-email-markus dot t dot metzger at intel dot com> <1386839747-8860-18-git-send-email-markus dot t dot metzger at intel dot com> <52AB555A dot 3070301 at redhat dot com> <A78C989F6D9628469189715575E55B230AA38C53 at IRSMSX104 dot ger dot corp dot intel dot com>
On 12/16/2013 10:53 AM, Metzger, Markus T wrote:
>> -----Original Message-----
>> From: Pedro Alves [mailto:palves@redhat.com]
>> Sent: Friday, December 13, 2013 7:44 PM
>
>
>> I must be missing something, but won't raw_memory_xfer_partial
>> keep trying in the target beneath, anyway?
>
> You're right. This function did not have any effect - and that was good;
> at least to some extent. Thanks for pointing this out!
>
> I changed the return -1 to throw_error (...) and added a check for
> writebuf != NULL. Suddenly I got tons of errors when GDB can't insert
> breakpoints any longer for (reverse-)stepping.
This is why precord keeps track of breakpoints itself too:
/* Behavior is conditional on RECORD_FULL_IS_REPLAY. We will not actually
insert or remove breakpoints in the real target when replaying, nor
when recording. */
static int
record_full_insert_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
> Also stepping gets broken.
I can't immediately why that would be.
>
> I still get the nice <unavailable> for function parameters. This fails
> already when trying to access the SP for computing the CFA.
>
> 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.
For traceframes what we do is GDB knows what memory is available
or isn't available before requesting it, through traceframe_available_memory.
See also:
https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html
(the discussion continued a little in the following month)
> To avoid those errors when trying to set breakpoints, I could try
> providing to_insert_breakpoint and to_remove_breakpoint methods
> and maintain my own breakpoints.
Right.
> Breakpoint conditions would still fail. Not sure what else I'm missing.
--
Pedro Alves