This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Regression for btrace [Re: [PATCH v4] gdb: clean up x86 cpuid implementations]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org, "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Date: Fri, 21 Jun 2013 13:18:00 +0200
- Subject: Regression for btrace [Re: [PATCH v4] gdb: clean up x86 cpuid implementations]
- References: <201305061451 dot 24861 dot vapier at gentoo dot org> <1371662677-16527-1-git-send-email-vapier at gentoo dot org> <51C1EC6E dot 4090402 at redhat dot com> <201306191829 dot 07274 dot vapier at gentoo dot org>
On Thu, 20 Jun 2013 00:29:05 +0200, Mike Frysinger wrote:
> On Wednesday 19 June 2013 13:37:50 Pedro Alves wrote:
> > On 06/19/2013 06:24 PM, Mike Frysinger wrote:
> > > * 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.
[...]
> pushed now
Running gdb/testsuite/gdb.btrace/function_call_history.exp ...
+PASS: gdb.btrace/function_call_history.exp: record btrace
+PASS: gdb.btrace/function_call_history.exp: continue to breakpoint: cont to 43
+PASS: gdb.btrace/function_call_history.exp: set record function-call-history-size 0
+FAIL: gdb.btrace/function_call_history.exp: record function-call-history - with size unlimited
[...]
+FAIL: gdb.btrace/function_call_history.exp: show recursive function call history
My Intel CPU is not btrace-capable but after the patch Intel vendor is no
longer correctly identified.
- "movl %%ebx, %0;"
- "movl %%edx, %1;"
- "movl %%ecx, %2;"
- : "=m" (vendor[0]),
- "=m" (vendor[4]),
- "=m" (vendor[8])
- :
- : "%eax", "%ebx", "%ecx", "%edx");
+ if (!i386_cpuid (0, NULL, &ebx, &ecx, &edx))
+ return 0;
+
+ memcpy (&vendor[0], &ebx, 4);
+ memcpy (&vendor[4], &ecx, 4);
+ memcpy (&vendor[8], &edx, 4);
Here ecx and edx are exchanged by the patch.
OK to check in the fix this way?
Jan
gdb/
2013-06-21 Jan Kratochvil <jan.kratochvil@redhat.com>
* common/linux-btrace.c (cpu_supports_btrace): Remove variable vendor,
replace strcmp with signature_INTEL_ebx, signature_INTEL_ecx and
signature_INTEL_edx comparisons.
diff --git a/gdb/common/linux-btrace.c b/gdb/common/linux-btrace.c
index 0ec13bb..b874c84 100644
--- a/gdb/common/linux-btrace.c
+++ b/gdb/common/linux-btrace.c
@@ -382,17 +382,12 @@ static int
cpu_supports_btrace (void)
{
unsigned int ebx, ecx, edx;
- char vendor[13];
if (!i386_cpuid (0, NULL, &ebx, &ecx, &edx))
return 0;
- memcpy (&vendor[0], &ebx, 4);
- memcpy (&vendor[4], &ecx, 4);
- memcpy (&vendor[8], &edx, 4);
- vendor[12] = '\0';
-
- if (strcmp (vendor, "GenuineIntel") == 0)
+ if (ebx == signature_INTEL_ebx && ecx == signature_INTEL_ecx
+ && edx == signature_INTEL_edx)
return intel_supports_btrace ();
/* Don't know about others. Let's assume they do. */