mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 10:09:16 +08:00
gdb/
* Makefile.in (gdbtypes_h, gdbtypes.o, utils.o): Update. * defs.h (hashtab_obstack_allocate, dummy_obstack_deallocate): Add prototypes. * dwarf2read.c (read_subroutine_type): Use TYPE_ZALLOC. (hashtab_obstack_allocate, dummy_obstack_deallocate): Moved to... * utils.c (hashtab_obstack_allocate, dummy_obstack_deallocate): ...here. * gdbtypes.c: Include "hashtab.h". (build_gdbtypes): Remove extra prototype. (struct type_pair, type_pair_hash, type_pair_eq) (create_copied_types_hash, copy_type_recursive): New. * gdbtypes.h: Include "hashtab.h". (TYPE_ZALLOC): New. (create_copied_types_hash, copy_type_recursive): New prototypes. * objfiles.c (free_objfile): Call preserve_values. * symfile.c (reread_symbols): Likewise. (clear_symtab_users): Remove calls to clear_value_history and clear_internalvars. * value.c (clear_value_history, clear_internalvars): Removed. (preserve_one_value, preserve_values): New functions. * value.h (clear_value_history, clear_internalvars): Removed. (preserve_values): New prototype. * tracepoint.c (_initialize_tracepoint): Do not initialize convenience variables here. gdb/doc/ * gdb.texinfo (Files): Remove obsolete bits from the description of "symbol-file".
This commit is contained in:
24
gdb/utils.c
24
gdb/utils.c
@ -53,6 +53,7 @@
|
||||
#include "annotate.h"
|
||||
#include "filenames.h"
|
||||
#include "symfile.h"
|
||||
#include "gdb_obstack.h"
|
||||
|
||||
#include "inferior.h" /* for signed_pointer_to_address */
|
||||
|
||||
@ -3124,3 +3125,26 @@ align_down (ULONGEST v, int n)
|
||||
gdb_assert (n && (n & (n-1)) == 0);
|
||||
return (v & -n);
|
||||
}
|
||||
|
||||
/* Allocation function for the libiberty hash table which uses an
|
||||
obstack. The obstack is passed as DATA. */
|
||||
|
||||
void *
|
||||
hashtab_obstack_allocate (void *data, size_t size, size_t count)
|
||||
{
|
||||
unsigned int total = size * count;
|
||||
void *ptr = obstack_alloc ((struct obstack *) data, total);
|
||||
memset (ptr, 0, total);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* Trivial deallocation function for the libiberty splay tree and hash
|
||||
table - don't deallocate anything. Rely on later deletion of the
|
||||
obstack. DATA will be the obstack, although it is not needed
|
||||
here. */
|
||||
|
||||
void
|
||||
dummy_obstack_deallocate (void *object, void *data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user