old-cross-binutils/gdb/testsuite/gdb.arch
Mike Frysinger 4d157a3dbe gdb: clean up x86 cpuid implementations
We've currently got 3 files doing open coded implementations of cpuid.
Each has its own set of workarounds and varying levels of how well
they're written and are generally hardcoded to specific cpuid functions.
If you try to build the latest gdb as a PIE on an i386 system, the build
will fail because one of them lacks PIC workarounds (wrt ebx).

Specifically, we have:
common/linux-btrace.c:
	two copies of cpuid asm w/specific args, one has no workarounds
	while the other implicitly does to avoid memcpy
go32-nat.c:
	two copies of cpuid asm w/specific args, one has workarounds to
	avoid memcpy
gdb/testsuite/gdb.arch/i386-cpuid.h:
	one general cpuid asm w/many workarounds copied from older gcc

Fortunately, that last header there is pretty damn good -- it handles
lots of edge cases, the code is nice & tight (uses gcc asm operands
rather than manual movs), and is already almost a general library type
header.  It's also the basis of what is now the public cpuid.h that is
shipped with gcc-4.3+.

So what I've done is pull that test header out and into gdb/common/
(not sure if there's a better place), synced to the version found in
gcc-4.8.0, put a wrapper API around it, and then cut over all the
existing call points to this new header.

Since the func already has support for "is cpuid supported on this proc",
it makes it trivial to push the i386/x86_64 ifdefs down into this wrapper
API too.  Now it can be safely used for all targets and gcc will elide
the unused code for us.

I've verified the gdb.arch testsuite still passes, and this code compiles
for an armv7a host as well as x86_64.  The go32-nat code has been left
ifdef-ed out until someone can test & verify the new stuff works (and if
it doesn't, figure out how to make the new code work).

URL: https://bugs.gentoo.org/467806
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-06-19 22:29:36 +00:00
..
alpha-step.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
alpha-step.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
altivec-abi.c
altivec-abi.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
altivec-regs.c
altivec-regs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-byte.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-disp-step.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-disp-step.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-dword.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value-inline.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value-inline.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value-inline.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value-param.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value-param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value-param.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-entry-value.s Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-i386-address.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-i386-address.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-prologue-xmm.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-prologue-xmm.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-prologue-xmm.s Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-pseudo.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-tailcall-cxx.exp gdb/ 2013-03-10 18:04:00 +00:00
amd64-tailcall-cxx1.cc gdb/ 2013-03-10 18:04:00 +00:00
amd64-tailcall-cxx1.S gdb/ 2013-03-10 18:04:00 +00:00
amd64-tailcall-cxx2.cc gdb/ 2013-03-10 18:04:00 +00:00
amd64-tailcall-cxx2.S gdb/ 2013-03-10 18:04:00 +00:00
amd64-tailcall-noret.c gdb/ 2013-03-10 18:06:26 +00:00
amd64-tailcall-noret.exp gdb/ 2013-03-10 18:06:26 +00:00
amd64-tailcall-noret.S gdb/ 2013-03-10 18:06:26 +00:00
amd64-tailcall-ret.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-tailcall-ret.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-tailcall-ret.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
amd64-word.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arm-bl-branch-dest.c Andrew Haley found a bug on GDB running on ARM when using 2013-04-22 09:20:33 +00:00
arm-bl-branch-dest.exp 2013-04-22 Sergio Durigan Junior <sergiodj@redhat.com> 2013-04-22 09:32:21 +00:00
arm-disp-step.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arm-disp-step.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
e500-abi.c
e500-abi.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
e500-prologue.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
e500-prologue.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
e500-regs.c
e500-regs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1291.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1291.s Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1431.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1431.s Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1558.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1558.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-avx.c gdb: clean up x86 cpuid implementations 2013-06-19 22:29:36 +00:00
i386-avx.exp gdb: clean up x86 cpuid implementations 2013-06-19 22:29:36 +00:00
i386-bp_permanent.exp Remove superfluous semicolons from testsuite throughout. 2013-06-07 17:31:09 +00:00
i386-byte.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-cfi-notcurrent.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-cfi-notcurrent.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-disp-step.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-disp-step.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-dr3-watch.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-dr3-watch.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-float.exp Fix the x87 FP register printout when issuing the “info float” command. 2013-04-19 14:13:30 +00:00
i386-float.S Fix the x87 FP register printout when issuing the “info float” command. 2013-04-19 14:13:30 +00:00
i386-gnu-cfi-asm.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-gnu-cfi.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-gnu-cfi.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-permbkpt.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-permbkpt.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-prologue.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-prologue.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-pseudo.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-signal.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-signal.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-size-overlap.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-size-overlap.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-size.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-size.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-sse-stack-align.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-sse-stack-align.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-sse-stack-align.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-sse.c gdb: clean up x86 cpuid implementations 2013-06-19 22:29:36 +00:00
i386-sse.exp gdb: clean up x86 cpuid implementations 2013-06-19 22:29:36 +00:00
i386-unwind.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-unwind.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
i386-word.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ia64-breakpoint-shadow.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ia64-breakpoint-shadow.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
iwmmxt-regs.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
iwmmxt-regs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
Makefile.in
mips-octeon-bbit.c
mips-octeon-bbit.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
mips16-thunks-inmain.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks-sin.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks-sinfrob.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks-sinfrob16.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks-sinmain.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks-sinmips16.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mips16-thunks.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pa-nullify.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pa-nullify.s
pa64-nullify.s
powerpc-aix-prologue.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
powerpc-aix-prologue.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
powerpc-d128-regs.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
powerpc-d128-regs.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
powerpc-prologue.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
powerpc-prologue.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ppc-dfp.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ppc-dfp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ppc-fp.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ppc-fp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ppc64-atomic-inst.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ppc64-atomic-inst.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
spu-info.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
spu-info.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
spu-ls.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
spu-ls.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb-bx-pc.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb-bx-pc.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb-prologue.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb-prologue.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb-singlestep.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb-singlestep.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb2-it.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
thumb2-it.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
vsx-regs.c
vsx-regs.exp * lib/gdb.exp (gdb_core_cmd): New function. 2013-05-06 22:11:16 +00:00