This is the mail archive of the
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: Wed, 25 Nov 2015 16:38:14 +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> <564F1C3D dot 1040709 at redhat dot com> <A78C989F6D9628469189715575E55B233322847F at IRSMSX104 dot ger dot corp dot intel dot com>
On 11/20/2015 01:59 PM, Metzger, Markus T wrote:
> Thanks for pointing this out. Let's try to fix it...
> Handling the "E.Btrace already enabled" error in remote.c shouldn't be too hard.
> This would at least allow another "record btrace" after reconnect - and it should
> keep the trace logs. This takes the same code path as a new enable so the check
> in this patch should suffice.
> A non-PT enabled GDB would try to fall back to BTS, though, so we could either
> implicitly disable PT in the target to allow it or give an error, which again leaves
> branch tracing unusable in this GDB session. But it would keep the trace logs if
> the user accidentally chose the wrong GDB for reconnecting.
> It would be nice if GDB could detect that record btrace is already enabled and push
> the record-btrace target automatically. I guess this requires some indication about
> the record status from gdbserver. Is there some other target that does this automatic
> push on (re-)connect that I could use as reference?
E.g., linux-thread-db.c pushes itself from a new_objfile observer (thread_db_new_objfile),
and the spu multiarch target pushes itself from an inferior_created observer
> This still leaves the question how GDB should behave if it doesn't support the tracing
> format that's already enabled in the GDBserver it just connected to.
I guess warn/error when you try to view/consume it, but still let you disable