aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-05-24 15:17:19 -0600
committerTom Tromey <tom@tromey.com>2022-07-28 14:16:50 -0600
commitbde539c2f9e19271d6d6c740f875b4129e03eba3 (patch)
tree0e92a4f02b0411afcf14297bc6c200c69ef62aee /gdb/guile
parentb382c16682acc33d2e81e5604c9dbd408be376d2 (diff)
downloadgdb-bde539c2f9e19271d6d6c740f875b4129e03eba3.zip
gdb-bde539c2f9e19271d6d6c740f875b4129e03eba3.tar.gz
gdb-bde539c2f9e19271d6d6c740f875b4129e03eba3.tar.bz2
Change allocation of type-copying hash table
When an objfile is destroyed, types that are still in use and allocated on that objfile are copied. A temporary hash map is created during this process, and it is allocated on the destroyed objfile's obstack -- which normally is fine, as that is going to be destroyed shortly anyway. However, this approach requires that the objfile be passed to registry destruction, and this won't be possible in the rewritten registry. This patch changes the copied type hash table to simply use the heap instead. It also removes the 'objfile' parameter from copy_type_recursive, to make this all more clear. This patch also fixes an apparent bug in copy_type_recursive. Previously it was copying the dynamic property list to the dying objfile's obstack: - = copy_dynamic_prop_list (&objfile->objfile_obstack, However I think this is incorrect -- that obstack is about to be destroyed.
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/scm-type.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 27d00f1..dd7eace 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -360,7 +360,7 @@ tyscm_copy_type_recursive (void **slot, void *info)
gdb_assert (objfile != NULL);
htab_empty (copied_types);
- t_smob->type = copy_type_recursive (objfile, t_smob->type, copied_types);
+ t_smob->type = copy_type_recursive (t_smob->type, copied_types);
/* The eq?-hashtab that the type lived in is going away.
Add the type to its new eq?-hashtab: Otherwise if/when the type is later
@@ -391,7 +391,7 @@ save_objfile_types (struct objfile *objfile, void *datum)
if (!gdb_scheme_initialized)
return;
- htab_up copied_types = create_copied_types_hash (objfile);
+ htab_up copied_types = create_copied_types_hash ();
if (htab != NULL)
{