This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [patch v4 13/13] btrace, x86: restrict to Atom


> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Tuesday, November 27, 2012 4:50 PM
> 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
> 
> 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.

Btrace is x86 specific. I don't know whether other architectures have similar features.

Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Peter Gleissner, 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]