Re: [PATCH v3] gdb: clean up x86 cpuid implementations

Pedro Alves
2013-06-19T11:43:53Z

On 06/19/2013 03:46 AM, Mike Frysinger wrote:

> i'm not trying to argue against ChangeLogs (i know it's a lost cause w/gdb).
> just pointing out that i prefer to wait to the last minute to write it since
> it has no real bearing on the actual code review.

It does have real bearing on the code review.

> here's the ChangeLog entries for this patch.
> gdb/:
> 2013-06-18 Mike Frysinger <vapier@gentoo.org>
>
> * Makefile.in (HFILES_NO_SRCDIR): Add common/i386-cpuid.h and
> common/i386-gcc-cpuid.h.

For example, from the diff alone, one can't tell where these were
being added.

> * common/i386-cpuid.h: New wrapper header around i386-gcc-cpuid.h.
> * common/i386-gcc-cpuid.h: Rename from testsuite/gdb.arch/i386-cpuid.h.
> Copy the latest version from upstream gcc.

And this is the only mention in the whole patch+intro of the importing
from the latest version from upstream gcc. ;-)

> * common/linux-btrace.c: Include i386-cpuid.h.
> (intel_supports_btrace): Delete x86 ifdefs and replace inline asm with
> call to i386_cpuid.
> (cpu_supports_btrace): Likewise.
> * go32-nat.c: Include i386-cpuid.h.
> (go32_sysinfo): Add (disabled) calls to i386_cpuid with comments.
>
> gdb/testsuite/:
> 2013-06-18 Mike Frysinger <vapier@gentoo.org>
>
> * gdb.arch/i386-avx.c (have_avx): Change __get_cpuid call to i386_cpuid.
> * gdb.arch/i386-avx.exp (additional_flags): Add -I${srcdir}/../common.
> * gdb.arch/i386-cpuid.h: Moved to ../common/i386-gcc-cpuid.h.
> * gdb.arch/i386-sse.c: Call new i386_cpuid function.
> * gdb.arch/i386-see.exp (additional_flags): Add -I${srcdir}/../common.

FAOD, this is OK.

However, BTW, I failed to notice this before, but:

> +++ b/gdb/common/i386-cpuid.h
> @@ -0,0 +1,68 @@
> +/*
> + * Copyright (C) 2007-2013 Free Software Foundation, Inc.
> + *
> + * This file is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 3, or (at your option) any
> + * later version.
> + *
> + * This file is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * General Public License for more details.
> + *
> + * Under Section 7 of GPL version 3, you are granted additional
> + * permissions described in the GCC Runtime Library Exception, version
> + * 3.1, as published by the Free Software Foundation.
> + *
> + * You should have received a copy of the GNU General Public License and
> + * a copy of the GCC Runtime Library Exception along with this program;
> + * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> + * <http://www.gnu.org/licenses/>.
> + */

This header only contains gdb bits. I don't see a reason for making
it GPL w/ runtime exception, rather than regular GPLv3+.
Was it just a copy/paste?

Thanks,
--
Pedro Alves