mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-25 11:16:56 +08:00
Use htab_up in type copying
This changes create_copied_types_hash to return an htab_up, then modifies the callers to avoid explicit use of htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * value.c (preserve_values): Update. * python/py-type.c (save_objfile_types): Update. * guile/scm-type.c (save_objfile_types): Update. * gdbtypes.h (create_copied_types_hash): Return htab_up. * gdbtypes.c (create_copied_types_hash): Return htab_up. * compile/compile-object-run.c (compile_object_run): Update.
This commit is contained in:
@ -1066,7 +1066,6 @@ static void
|
||||
save_objfile_types (struct objfile *objfile, void *datum)
|
||||
{
|
||||
type_object *obj = (type_object *) datum;
|
||||
htab_t copied_types;
|
||||
|
||||
if (!gdb_python_initialized)
|
||||
return;
|
||||
@ -1075,23 +1074,22 @@ save_objfile_types (struct objfile *objfile, void *datum)
|
||||
operating on. */
|
||||
gdbpy_enter enter_py (objfile->arch (), current_language);
|
||||
|
||||
copied_types = create_copied_types_hash (objfile);
|
||||
htab_up copied_types = create_copied_types_hash (objfile);
|
||||
|
||||
while (obj)
|
||||
{
|
||||
type_object *next = obj->next;
|
||||
|
||||
htab_empty (copied_types);
|
||||
htab_empty (copied_types.get ());
|
||||
|
||||
obj->type = copy_type_recursive (objfile, obj->type, copied_types);
|
||||
obj->type = copy_type_recursive (objfile, obj->type,
|
||||
copied_types.get ());
|
||||
|
||||
obj->next = NULL;
|
||||
obj->prev = NULL;
|
||||
|
||||
obj = next;
|
||||
}
|
||||
|
||||
htab_delete (copied_types);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user