summaryrefslogtreecommitdiff
path: root/gdb/windows-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-13 09:53:35 -0600
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:37 -0600
commitcc495054ad5cd22cfc3b3de5fc962af7f6b4e8d5 (patch)
tree25e65ef71b881a1355bda4ea239258d578e09efd /gdb/windows-tdep.c
parent95751990e40d88986205ba3c0719b8afd3da0e7e (diff)
downloadbinutils-gdb-cc495054ad5cd22cfc3b3de5fc962af7f6b4e8d5.tar.gz
Remove arch_type
This removes arch_type, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/windows-tdep.c')
-rw-r--r--gdb/windows-tdep.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 97199527c8b..5a58aa37953 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -214,6 +214,8 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
if (windows_gdbarch_data->tib_ptr_type != nullptr)
return windows_gdbarch_data->tib_ptr_type;
+ type_allocator alloc (gdbarch);
+
dword_ptr_type = arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch),
1, "DWORD_PTR");
dword32_type = arch_integer_type (gdbarch, 32,
@@ -243,9 +245,9 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
seh_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
seh_type->set_name (xstrdup ("seh"));
- seh_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- void_ptr_type->length () * TARGET_CHAR_BIT,
- NULL);
+ seh_ptr_type = alloc.new_type (TYPE_CODE_PTR,
+ void_ptr_type->length () * TARGET_CHAR_BIT,
+ NULL);
seh_ptr_type->set_target_type (seh_type);
append_composite_type_field (seh_type, "next_seh", seh_ptr_type);
@@ -264,9 +266,9 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
append_composite_type_field (peb_ldr_type, "in_init_order", list_type);
append_composite_type_field (peb_ldr_type, "entry_in_progress",
void_ptr_type);
- peb_ldr_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- void_ptr_type->length () * TARGET_CHAR_BIT,
- NULL);
+ peb_ldr_ptr_type = alloc.new_type (TYPE_CODE_PTR,
+ void_ptr_type->length () * TARGET_CHAR_BIT,
+ NULL);
peb_ldr_ptr_type->set_target_type (peb_ldr_type);
/* struct UNICODE_STRING */
@@ -334,9 +336,9 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
append_composite_type_field (peb_type, "sub_system_data", void_ptr_type);
append_composite_type_field (peb_type, "process_heap", void_ptr_type);
append_composite_type_field (peb_type, "fast_peb_lock", void_ptr_type);
- peb_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- void_ptr_type->length () * TARGET_CHAR_BIT,
- NULL);
+ peb_ptr_type = alloc.new_type (TYPE_CODE_PTR,
+ void_ptr_type->length () * TARGET_CHAR_BIT,
+ NULL);
peb_ptr_type->set_target_type (peb_type);
@@ -378,9 +380,9 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
/* uint32_t last_error_number; %fs:0x0034 */
append_composite_type_field (tib_type, "last_error_number", dword_ptr_type);
- tib_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- void_ptr_type->length () * TARGET_CHAR_BIT,
- NULL);
+ tib_ptr_type = alloc.new_type (TYPE_CODE_PTR,
+ void_ptr_type->length () * TARGET_CHAR_BIT,
+ NULL);
tib_ptr_type->set_target_type (tib_type);
windows_gdbarch_data->tib_ptr_type = tib_ptr_type;
@@ -742,7 +744,7 @@ create_enum (struct gdbarch *gdbarch, int bit, const char *name,
struct type *type;
int i;
- type = arch_type (gdbarch, TYPE_CODE_ENUM, bit, name);
+ type = type_allocator (gdbarch).new_type (TYPE_CODE_ENUM, bit, name);
type->set_num_fields (count);
type->set_fields
((struct field *) TYPE_ZALLOC (type, sizeof (struct field) * count));