aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2022-10-20 16:27:34 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2022-10-28 07:42:53 +0200
commitd9757bcd43534875d2003962944d3d130289f82c (patch)
tree762649eb1617abf90e025e2155a188aaab6f43f1 /gdb/nat
parent56d4450bdfc873ff3c2d1ebb194c7a076d4d13f6 (diff)
downloadgdb-d9757bcd43534875d2003962944d3d130289f82c.zip
gdb-d9757bcd43534875d2003962944d3d130289f82c.tar.gz
gdb-d9757bcd43534875d2003962944d3d130289f82c.tar.bz2
gdb, btrace: fix family and model computation
In gdb/nat/linux-btrace.c:btrace_this_cpu() we initialize the cpu structure given to the libipt btrace decoder. We only consider the extended model field for family 0x6 and forget about family 0xf and we don't consider the extended family field. Fix it.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/linux-btrace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index 4911630..a951f3b 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -84,9 +84,11 @@ btrace_this_cpu (void)
cpu.vendor = CV_INTEL;
cpu.family = (cpuid >> 8) & 0xf;
- cpu.model = (cpuid >> 4) & 0xf;
+ if (cpu.family == 0xf)
+ cpu.family += (cpuid >> 20) & 0xff;
- if (cpu.family == 0x6)
+ cpu.model = (cpuid >> 4) & 0xf;
+ if ((cpu.family == 0x6) || ((cpu.family & 0xf) == 0xf))
cpu.model += (cpuid >> 12) & 0xf0;
}
}