Re: x86: gdt_page and debugging from gdb against /proc
From: Brian Gerst
Date: Fri Oct 07 2011 - 08:00:17 EST
On Fri, Oct 7, 2011 at 7:18 AM, myname <33user@xxxxxxxxx> wrote:
> in kernel/cpu/kernel/common.c, the initialization for the gdt_table symbol is like the following:
> Â Â Â Â[GDT_ENTRY_KERNEL_CS] Â Â Â Â Â = GDT_ENTRY_INIT(0xc09a, 0, 0xfffff),
> Â Â Â Â[GDT_ENTRY_KERNEL_DS] Â Â Â Â Â = GDT_ENTRY_INIT(0xc092, 0, 0xfffff),
> Â Â Â Â[GDT_ENTRY_DEFAULT_USER_CS] Â Â = GDT_ENTRY_INIT(0xc0fa, 0, 0xfffff),
> Â Â Â Â[GDT_ENTRY_DEFAULT_USER_DS] Â Â = GDT_ENTRY_INIT(0xc0f2, 0, 0xfffff),
> Â Â Â Âso, that the gtd_page should have base = 0, and limit = 0xffffff, and so on for the next 3 slots in the array.
> now if i do: `sudo gdb -q ~/linux-3.0.3/vmlinux /proc/kcore' and in gdb ask for the command p/t gdt_table, i get, which obviously if you check for base and limit in member 12, 13 and so on, doesn't fit the above description. why?
gdt_page is a per-cpu variable, so you are looking at the original
location in init mem that has been overwritten with other data.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/