From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24691 invoked by alias); 27 Nov 2012 15:50:11 -0000 Received: (qmail 24681 invoked by uid 22791); 27 Nov 2012 15:50:09 -0000 X-SWARE-Spam-Status: No, hits=-7.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Nov 2012 15:49:59 +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 (8.14.4/8.14.4) with ESMTP id qARFnuQ4008404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Nov 2012 10:49:57 -0500 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 qARFns0l005399; Tue, 27 Nov 2012 10:49:55 -0500 Message-ID: <50B4E122.80906@redhat.com> Date: Tue, 27 Nov 2012 15:50:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "Metzger, Markus T" CC: Jan Kratochvil , "gdb-patches@sourceware.org" , "markus.t.metzger@gmail.com" , "tromey@redhat.com" , "kettenis@gnu.org" Subject: Re: [patch v4 13/13] btrace, x86: restrict to Atom References: <1354013351-14791-1-git-send-email-markus.t.metzger@intel.com> <1354013351-14791-14-git-send-email-markus.t.metzger@intel.com> <20121127130500.GA22431@host2.jankratochvil.net> <20121127142904.GA30650@host2.jankratochvil.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-11/txt/msg00746.txt.bz2 On 11/27/2012 03:13 PM, Metzger, Markus T wrote: >> -----Original Message----- >> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] >> Sent: Tuesday, November 27, 2012 3:29 PM >> To: Metzger, Markus T >> Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; palves@redhat.com; tromey@redhat.com; kettenis@gnu.org >> Subject: Re: [patch v4 13/13] btrace, x86: restrict to Atom >> >> On Tue, 27 Nov 2012 15:03:48 +0100, Metzger, Markus T wrote: >>>> There is i386-nat.c for the common functions between these two files. >>> >>> Is it OK put Linux specific code into i386-nat.c? >> >> True it is not so clear, it would be OK as long as the linux_supports_btrace() >> call is moved out of it, as otherwise it just checks the CPU hardware feature. >> >> But as you use it also in gdbserver I see now it can be moved to >> common/linux-btrace.[ch] with appropriate #ifdef __i386__ and __x86_64__. >> common/ currently does not have any per-file arch/target configury like gdb/ >> and gdbserver/ have, one day it will probably have it but not now. > > I can do this. It should also simplify some of the code if I can do the check there. > > Can I expect that others will be OK with this, as well? Well, I don't agree with _that_ reasoning. We don't have _any_ configury in common/, because common/ is not a library. The configury is in gdb/ and gdb/gdbserver/. I don't see any issue preventing splitting architecture specific code to separate files, as we do in gdb/ and gdbserver/. It's just that the source file is named common/foo.c rather than foo.c. That said, btrace is inherently x86-specific, right? Is there any other architecture that does something of the sort? If not, then I agree with assuming x86 in the file, and #ifdef where necessary to distinguish 32-bit/64-bit. -- Pedro Alves