This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v8 24/24] record-btrace: add (reverse-)stepping support
- 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>, Eli Zaretskii <eliz at gnu dot org>
- Date: Tue, 17 Dec 2013 20:41:09 +0000
- Subject: Re: [patch v8 24/24] record-btrace: add (reverse-)stepping support
- Authentication-results: sourceware.org; auth=none
- References: <1386839747-8860-1-git-send-email-markus dot t dot metzger at intel dot com> <1386839747-8860-25-git-send-email-markus dot t dot metzger at intel dot com> <52AB5E6A dot 1010105 at redhat dot com> <A78C989F6D9628469189715575E55B230AA38F1D at IRSMSX104 dot ger dot corp dot intel dot com> <52AF62CB dot 7010805 at redhat dot com> <A78C989F6D9628469189715575E55B230AA39796 at IRSMSX104 dot ger dot corp dot intel dot com> <A78C989F6D9628469189715575E55B230AA39866 at IRSMSX104 dot ger dot corp dot intel dot com> <A78C989F6D9628469189715575E55B230AA39911 at IRSMSX104 dot ger dot corp dot intel dot com>
On 12/17/2013 03:47 PM, Metzger, Markus T wrote:
>> -----Original Message-----
>> From: Metzger, Markus T
>> Sent: Tuesday, December 17, 2013 4:06 PM
>> To: Pedro Alves
>
>
>> I'm beginning to wonder if we should actually adjust the PC for
>> btrace replay. The way I interpret the function, we got a SIGTRAP
>> for executing the breakpoint instruction. The PC is after the breakpoint
>> instruction, so it is one byte after the actual breakpoint location. We're
>> now trying to undo the execution of the breakpoint instruction.
>> Is this correct?
>>
>> In that case, we shouldn't adjust the PC since we did not execute
>> the breakpoint instruction in the trace. We just asked whether there
>> is a breakpoint at the current location.
>>
>> This seems to be different for s/w record. This is the first time, I need
>> to distinguish between the different record targets.
>
> The s/w record target also does not execute the breakpoint instruction.
> It increments the PC by gdbarch_decr_pc_after_break () when it finds a
> s/w breakpoint at the current location.
>
> I wonder why they are doing that. Is this a workaround that was considered
> less intrusive than what I am proposing below?
It just seemed better at the time. When it was originally submitted
the precord target was a lot more invasive in the core side, and
I pushed for redoing it as a target (new stratum), and make it
as transparent as possible. The current decr_pc_after_break
handling was a result of that mindset. I'm not seeing a reason
your suggested direction couldn't work for the s/w record target
too.
--
Pedro Alves