From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6722 invoked by alias); 5 Dec 2012 09:27:59 -0000 Received: (qmail 6712 invoked by uid 22791); 5 Dec 2012 09:27:58 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Dec 2012 09:27:51 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 05 Dec 2012 01:27:04 -0800 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga002.jf.intel.com with ESMTP; 05 Dec 2012 01:27:49 -0800 Received: from irsmsx152.ger.corp.intel.com (163.33.192.66) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.1.355.2; Wed, 5 Dec 2012 09:27:38 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.95]) by IRSMSX152.ger.corp.intel.com ([169.254.6.36]) with mapi id 14.01.0355.002; Wed, 5 Dec 2012 09:27:38 +0000 From: "Metzger, Markus T" To: Pedro Alves CC: "gdb-patches@sourceware.org" , "markus.t.metzger@gmail.com" , "jan.kratochvil@redhat.com" , "tromey@redhat.com" , "kettenis@gnu.org" Subject: RE: [patch v4 10/13] gdbserver, linux, btrace: add btrace support for linux-low Date: Wed, 05 Dec 2012 09:27:00 -0000 Message-ID: References: <1354013351-14791-1-git-send-email-markus.t.metzger@intel.com> <1354013351-14791-11-git-send-email-markus.t.metzger@intel.com> <50B6779B.7010509@redhat.com> In-Reply-To: <50B6779B.7010509@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2012-12/txt/msg00070.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Wednesday, November 28, 2012 9:44 PM > To: Metzger, Markus T > Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; jan.kratochvi= l@redhat.com; tromey@redhat.com; > kettenis@gnu.org > Subject: Re: [patch v4 10/13] gdbserver, linux, btrace: add btrace suppor= t for linux-low >=20 > On 11/27/2012 10:49 AM, markus.t.metzger@intel.com wrote: > > From: Markus Metzger > > > > Implement btrace target ops in target linux-low using the common linux-= btrace > > functions. > > > > Add linux-btrace.o to all targets that link linux-low.o. I'd rather not= link it > > to targets that do not support branch tracing, but this would require c= hanging > > the way target ops are defined for gdbserver. >=20 > A simple way to do this would be to have configure.src set srv_linux_btra= ce=3Dyes > and then configure.ac would do: >=20 > if test "${srv_linux_btrace}" =3D "yes"; then > AC_DEFINE(HAVE_BTRACE, 1, > [Define if the target supports branch tracing]) > fi >=20 > You'd then do e.g.,: >=20 > @@ -5858,6 +5884,11 @@ static struct target_ops linux_target_ops =3D { > linux_get_min_fast_tracepoint_insn_len, > linux_qxfer_libraries_svr4, > linux_supports_agent, > + #if HAVE_BTRACE > + linux_supports_btrace, > + linux_enable_btrace, > + linux_disable_btrace, > + linux_btrace_has_changed, > + linux_low_read_btrace, > + #endif > }; Thanks. I'll do just that. This removes the bulk of the feature for targets that do not support it. It= leaves the function pointer fields in struct target_ops and the communicat= ion in server.c. If we are very conscious about gdbserver code size, I can = guard those, as well. Regards, Markus. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052