+2018-03-18 Tom Tromey <tom@tromey.com>
+
+ * solib.c (gdb_bfd_lookup_symbol_from_symtab): Use
+ gdb::def_vector.
+ (bfd_lookup_symbol_from_dyn_symtab): Likewise.
+
2018-03-17 Tom Tromey <tom@tromey.com>
* auto-load.c (auto_load_objfile_script_1): Use std::string.
{
unsigned int i;
- asymbol **symbol_table = (asymbol **) xmalloc (storage_needed);
- struct cleanup *back_to = make_cleanup (xfree, symbol_table);
+ gdb::def_vector<asymbol *> storage (storage_needed / sizeof (asymbol *));
+ asymbol **symbol_table = storage.data ();
unsigned int number_of_symbols =
bfd_canonicalize_symtab (abfd, symbol_table);
break;
}
}
- do_cleanups (back_to);
}
return symaddr;
if (storage_needed > 0)
{
unsigned int i;
- asymbol **symbol_table = (asymbol **) xmalloc (storage_needed);
- struct cleanup *back_to = make_cleanup (xfree, symbol_table);
+ gdb::def_vector<asymbol *> storage (storage_needed / sizeof (asymbol *));
+ asymbol **symbol_table = storage.data ();
unsigned int number_of_symbols =
bfd_canonicalize_dynamic_symtab (abfd, symbol_table);
break;
}
}
- do_cleanups (back_to);
}
return symaddr;
}