From ea1fae46d894fe78aec8a26e8e167b5352265624 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Fri, 30 Apr 2010 15:38:42 +0000 Subject: [PATCH] * windows-tdep.c (windows_get_tlb_type): Remember last GDBARCH and created type for re-use. --- gdb/ChangeLog | 5 +++++ gdb/windows-tdep.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 135d9d9..1b9094f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2010-04-30 Pierre Muller + * windows-tdep.c (windows_get_tlb_type): Remember last GDBARCH + and created type for re-use. + +2010-04-30 Pierre Muller + * NEWS: Mention gdbserver support for x86_64 Windows 64-bit. 2010-04-29 Doug Evans diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 50dfbe2..84f42e0 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -97,12 +97,18 @@ static int maint_display_all_tib = 0; static struct type * windows_get_tlb_type (struct gdbarch *gdbarch) { + static struct gdbarch *last_gdbarch = NULL; + static struct type *last_tlb_type = NULL; struct type *dword_ptr_type, *dword32_type, *void_ptr_type; struct type *peb_ldr_type, *peb_ldr_ptr_type; struct type *peb_type, *peb_ptr_type, *list_type, *list_ptr_type; struct type *module_list_ptr_type; struct type *tib_type, *seh_type, *tib_ptr_type, *seh_ptr_type; + /* Do not rebuild type if same gdbarch as last time. */ + if (last_tlb_type && last_gdbarch == gdbarch) + return last_tlb_type; + dword_ptr_type = arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), 1, "DWORD_PTR"); dword32_type = arch_integer_type (gdbarch, 32, @@ -211,6 +217,9 @@ windows_get_tlb_type (struct gdbarch *gdbarch) TYPE_LENGTH (void_ptr_type), NULL); TYPE_TARGET_TYPE (tib_ptr_type) = tib_type; + last_tlb_type = tib_ptr_type; + last_gdbarch = gdbarch; + return tib_ptr_type; } -- 2.7.4