Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Markus Metzger <markus.t.metzger@intel.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] btrace: diagnose "record btrace pt" without libipt
Date: Fri, 20 Nov 2015 11:35:00 -0000	[thread overview]
Message-ID: <564F0591.3020006@redhat.com> (raw)
In-Reply-To: <1448011026-4192-1-git-send-email-markus.t.metzger@intel.com>

On 11/20/2015 09:17 AM, Markus Metzger wrote:
> If GDB has been configured without libipt support, i.e. HAVE_LIBIPT is
> undefined, and is running on a system that supports Intel(R) Processor Trace,
> GDB will run into an internal error when trying to decode the trace.
> 
>     (gdb) record btrace
>     (gdb) s
>     usage (name=0x7fffffffe954 "fib-64")
>         at src/fib.c:12
>     12          fprintf(stderr, "usage: %s <num>\n", name);
>     (gdb) info record
>     Active record target: record-btrace
>     Recording format: Intel(R) Processor Trace.
>     Buffer size: 16kB.
>     gdb/btrace.c:971: internal-error: Unexpected branch trace format.
>     A problem internal to GDB has been detected,
>     further debugging may prove unreliable.
>     Quit this debugging session? (y or n)
> 
> This requires a system with Linux kernel 4.1 or later running on a 5th
> Generation Intel Core processor or later.
> 
> When trying to enable branch tracing, in addition to checking the target
> support for the requested branch tracing format, also check whether GDB
> supports. it.

BTW, this made me wonder what happens if you're remote debugging with
gdbserver, and then:

 #1 - enable btrace pt
 #2 - disconnect with "disconnect"
 #3 - restart gdb
 #4 - reconnect to gdbserver

- Does gdb sync the "btrace-enabled" state with the server?  Or does it get out
  of sync and confused?

- What if btrace pt was enabled on the inferior, and the gdb that reconnects
  in #4 above is compiled _without_ libipt?  Will "info record" still crash?

Thanks,
Pedro Alves


  parent reply	other threads:[~2015-11-20 11:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  9:17 Markus Metzger
2015-11-20 11:31 ` Pedro Alves
2015-11-20 11:35 ` Pedro Alves [this message]
2015-11-20 12:11   ` Metzger, Markus T
2015-11-20 13:12     ` Pedro Alves
2015-11-20 13:59       ` Metzger, Markus T
2015-11-25 16:38         ` Pedro Alves
2015-11-26  7:12           ` Metzger, Markus T
2015-11-26  9:43             ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564F0591.3020006@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox