This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v8 23/24] record-btrace: show trace from enable location
- 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:41:23 +0000
- Subject: Re: [patch v8 23/24] record-btrace: show trace from enable location
- Authentication-results: sourceware.org; auth=none
- References: <1386839747-8860-1-git-send-email-markus dot t dot metzger at intel dot com> <1386839747-8860-24-git-send-email-markus dot t dot metzger at intel dot com> <52AB64F3 dot 3010305 at redhat dot com> <A78C989F6D9628469189715575E55B230AA38D11 at IRSMSX104 dot ger dot corp dot intel dot com>
On 12/16/2013 12:56 PM, Metzger, Markus T wrote:
>> -----Original Message-----
>> From: Pedro Alves [mailto:palves@redhat.com]
>> Sent: Friday, December 13, 2013 8:50 PM
>
>
>>> After adding incremental updates, we can now add a dummy record for the
>> current
>>> PC when we enable tracing so we show the trace from the location where
>> branch
>>> tracing has been enabled.
>>
>> Ah, awesome, I was just wondering about that. :-)
>>
>> I suppose one can we still access the registers when
>> inspecting this dummy location, or are the btrace unwinders
>> preventing that?
>
> You can not access registers when you are in the execution history.
>
> When we add this dummy record when we enable tracing, you're still
> outside the execution history, so you can access registers. Also the last
> instruction will be skipped for all record operations - it corresponds to
> the current PC and the instruction has not been executed yet.
>
> But it allows us to stitch the first trace chunk to this dummy record and
> thus show the full trace from the enable location.
>
> Internally, you're at the same PC if you are replaying and the replay
> position is at the last instruction or if you are not replaying.
> The different is that you will be able to access registers and memory
> only if you are not replaying.
OK, the question was then, would it be wrong to allow
accessing registers and memory of the live program, if replaying, and
at that position? Just OOC and for my education, I'm not saying
it'd be a requirement.
Sorry if the question sounds dumb. I can't actually try out this
stuff due to broken btrace on my machine, if you'll recall.
> You will also have normal dward2 frames
> in that case. If you are replaying, you will have btrace frames and you
> won't be able to access all registers and memory.
>
> In record commands, we stop replaying once we reach the last instruction.
--
Pedro Alves