From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34389 invoked by alias); 20 Nov 2015 11:35:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 34363 invoked by uid 89); 20 Nov 2015 11:35:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 20 Nov 2015 11:35:48 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 29CA1570E; Fri, 20 Nov 2015 11:35:47 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAKBZjBK012846; Fri, 20 Nov 2015 06:35:46 -0500 Message-ID: <564F0591.3020006@redhat.com> Date: Fri, 20 Nov 2015 11:35:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Markus Metzger CC: gdb-patches@sourceware.org Subject: Re: [PATCH] btrace: diagnose "record btrace pt" without libipt References: <1448011026-4192-1-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1448011026-4192-1-git-send-email-markus.t.metzger@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00420.txt.bz2 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 \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