This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] btrace: diagnose "record btrace pt" without libipt
- From: Pedro Alves <palves at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 20 Nov 2015 13:12:29 +0000
- Subject: Re: [PATCH] btrace: diagnose "record btrace pt" without libipt
- Authentication-results: sourceware.org; auth=none
- References: <1448011026-4192-1-git-send-email-markus dot t dot metzger at intel dot com> <564F0591 dot 3020006 at redhat dot com> <A78C989F6D9628469189715575E55B23332283DF at IRSMSX104 dot ger dot corp dot intel dot com>
On 11/20/2015 12:11 PM, Metzger, Markus T wrote:
> The record target is popped off the target stack on disconnect. This disables
> branch tracing. The below log is for BTS but the logic is the same for PT.
> Sending packet: $Qbtrace:off#37...Packet received: OK
>
> After reconnecting, you need to enable btrace again.
I see. But then it sounds like we'll have the problem if the connection
drops unexpectedly -- gdb won't be able to tell the server to
disable Qbtrace. I guess the easiest way to emulate is kill gdb:
#1 - enable btrace pt
#2 - connection is terminated unexpectedly / kill gdb
#3 - reconnect to gdbserver
a) Does the new gdb get out of sync and confused?
b) What if btrace pt was enabled on the inferior, and the gdb that
reconnects in #3 above is compiled _without_ libipt?
Will "info record" still crash? What I'm thinking is that
a similar format check may be necessary around this code path,
not only at PT enable time.
Thanks,
Pedro Alves