summaryrefslogtreecommitdiff
path: root/gdb/windows-tdep.c
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2010-04-30 15:38:40 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2010-04-30 15:38:40 +0000
commitb319a9de41dbab17e8c4c6cb87ad56b7b6e5c582 (patch)
tree6a27c6e1e98a269a8e2c0a468c19e17f80d45cbd /gdb/windows-tdep.c
parent7b57f4a47be72d3d85cb208a98f5ac386fd7cbfb (diff)
downloadgdb-b319a9de41dbab17e8c4c6cb87ad56b7b6e5c582.tar.gz
* windows-tdep.c (windows_get_tlb_type): Remember last GDBARCH
and created type for re-use.
Diffstat (limited to 'gdb/windows-tdep.c')
-rw-r--r--gdb/windows-tdep.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 50dfbe21c98..84f42e06051 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;
}