Prepare gdb for 64-bit obstacks
* charset.c (convert_between_encodings): Cast result of obstack_base. * cp-valprint.c (cp_print_value_fields): Use size_t locals. * hppa-tdep.c (internalize_unwinds): Change "size" parm to size_t. (read_unwind_info): Use size_t for some locals. * jit.c (finalize_symtab): Likewise. * utils.c (hashtab_obstack_allocate): Likewise. * symmisc.c (print_objfile_statistics): Update format strings.
This commit is contained in:
parent
8479caa193
commit
241fd515ad
7 changed files with 29 additions and 16 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2014-08-05 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* charset.c (convert_between_encodings): Cast result of obstack_base.
|
||||||
|
* cp-valprint.c (cp_print_value_fields): Use size_t locals.
|
||||||
|
* hppa-tdep.c (internalize_unwinds): Change "size" parm to size_t.
|
||||||
|
(read_unwind_info): Use size_t for some locals.
|
||||||
|
* jit.c (finalize_symtab): Likewise.
|
||||||
|
* utils.c (hashtab_obstack_allocate): Likewise.
|
||||||
|
* symmisc.c (print_objfile_statistics): Update format strings.
|
||||||
|
|
||||||
2014-08-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2014-08-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
* NEWS (Changes in GDB-4.0): Move Intel MPX and Intel AVX-512 items ...
|
* NEWS (Changes in GDB-4.0): Move Intel MPX and Intel AVX-512 items ...
|
||||||
|
|
|
@ -503,7 +503,7 @@ convert_between_encodings (const char *from, const char *to,
|
||||||
old_size = obstack_object_size (output);
|
old_size = obstack_object_size (output);
|
||||||
obstack_blank (output, space_request);
|
obstack_blank (output, space_request);
|
||||||
|
|
||||||
outp = obstack_base (output) + old_size;
|
outp = (char *) obstack_base (output) + old_size;
|
||||||
outleft = space_request;
|
outleft = space_request;
|
||||||
|
|
||||||
r = iconv (desc, &inp, &inleft, &outp, &outleft);
|
r = iconv (desc, &inp, &inleft, &outp, &outleft);
|
||||||
|
|
|
@ -208,8 +208,8 @@ cp_print_value_fields (struct type *type, struct type *real_type,
|
||||||
fprintf_filtered (stream, "<No data fields>");
|
fprintf_filtered (stream, "<No data fields>");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int statmem_obstack_initial_size = 0;
|
size_t statmem_obstack_initial_size = 0;
|
||||||
int stat_array_obstack_initial_size = 0;
|
size_t stat_array_obstack_initial_size = 0;
|
||||||
struct type *vptr_basetype = NULL;
|
struct type *vptr_basetype = NULL;
|
||||||
int vptr_fieldno;
|
int vptr_fieldno;
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
|
||||||
|
|
||||||
if (dont_print_statmem == 0)
|
if (dont_print_statmem == 0)
|
||||||
{
|
{
|
||||||
int obstack_final_size =
|
size_t obstack_final_size =
|
||||||
obstack_object_size (&dont_print_statmem_obstack);
|
obstack_object_size (&dont_print_statmem_obstack);
|
||||||
|
|
||||||
if (obstack_final_size > statmem_obstack_initial_size)
|
if (obstack_final_size > statmem_obstack_initial_size)
|
||||||
|
@ -387,7 +387,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
|
||||||
|
|
||||||
if (last_set_recurse != recurse)
|
if (last_set_recurse != recurse)
|
||||||
{
|
{
|
||||||
int obstack_final_size =
|
size_t obstack_final_size =
|
||||||
obstack_object_size (&dont_print_stat_array_obstack);
|
obstack_object_size (&dont_print_stat_array_obstack);
|
||||||
|
|
||||||
if (obstack_final_size > stat_array_obstack_initial_size)
|
if (obstack_final_size > stat_array_obstack_initial_size)
|
||||||
|
|
|
@ -221,7 +221,7 @@ record_text_segment_lowaddr (bfd *abfd, asection *section, void *data)
|
||||||
static void
|
static void
|
||||||
internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
|
internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
|
||||||
asection *section, unsigned int entries,
|
asection *section, unsigned int entries,
|
||||||
unsigned int size, CORE_ADDR text_offset)
|
size_t size, CORE_ADDR text_offset)
|
||||||
{
|
{
|
||||||
/* We will read the unwind entries into temporary memory, then
|
/* We will read the unwind entries into temporary memory, then
|
||||||
fill in the actual unwind table. */
|
fill in the actual unwind table. */
|
||||||
|
@ -320,7 +320,7 @@ static void
|
||||||
read_unwind_info (struct objfile *objfile)
|
read_unwind_info (struct objfile *objfile)
|
||||||
{
|
{
|
||||||
asection *unwind_sec, *stub_unwind_sec;
|
asection *unwind_sec, *stub_unwind_sec;
|
||||||
unsigned unwind_size, stub_unwind_size, total_size;
|
size_t unwind_size, stub_unwind_size, total_size;
|
||||||
unsigned index, unwind_entries;
|
unsigned index, unwind_entries;
|
||||||
unsigned stub_entries, total_entries;
|
unsigned stub_entries, total_entries;
|
||||||
CORE_ADDR text_offset;
|
CORE_ADDR text_offset;
|
||||||
|
|
|
@ -637,7 +637,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
|
||||||
struct symtab *symtab;
|
struct symtab *symtab;
|
||||||
struct gdb_block *gdb_block_iter, *gdb_block_iter_tmp;
|
struct gdb_block *gdb_block_iter, *gdb_block_iter_tmp;
|
||||||
struct block *block_iter;
|
struct block *block_iter;
|
||||||
int actual_nblocks, i, blockvector_size;
|
int actual_nblocks, i;
|
||||||
|
size_t blockvector_size;
|
||||||
CORE_ADDR begin, end;
|
CORE_ADDR begin, end;
|
||||||
struct blockvector *bv;
|
struct blockvector *bv;
|
||||||
|
|
||||||
|
@ -650,9 +651,9 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
|
||||||
/* Copy over the linetable entry if one was provided. */
|
/* Copy over the linetable entry if one was provided. */
|
||||||
if (stab->linetable)
|
if (stab->linetable)
|
||||||
{
|
{
|
||||||
int size = ((stab->linetable->nitems - 1)
|
size_t size = ((stab->linetable->nitems - 1)
|
||||||
* sizeof (struct linetable_entry)
|
* sizeof (struct linetable_entry)
|
||||||
+ sizeof (struct linetable));
|
+ sizeof (struct linetable));
|
||||||
LINETABLE (symtab) = obstack_alloc (&objfile->objfile_obstack, size);
|
LINETABLE (symtab) = obstack_alloc (&objfile->objfile_obstack, size);
|
||||||
memcpy (LINETABLE (symtab), stab->linetable, size);
|
memcpy (LINETABLE (symtab), stab->linetable, size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,10 +143,12 @@ print_objfile_statistics (void)
|
||||||
if (OBJSTAT (objfile, sz_strtab) > 0)
|
if (OBJSTAT (objfile, sz_strtab) > 0)
|
||||||
printf_filtered (_(" Space used by a.out string tables: %d\n"),
|
printf_filtered (_(" Space used by a.out string tables: %d\n"),
|
||||||
OBJSTAT (objfile, sz_strtab));
|
OBJSTAT (objfile, sz_strtab));
|
||||||
printf_filtered (_(" Total memory used for objfile obstack: %d\n"),
|
printf_filtered (_(" Total memory used for objfile obstack: %s\n"),
|
||||||
obstack_memory_used (&objfile->objfile_obstack));
|
pulongest (obstack_memory_used (&objfile
|
||||||
printf_filtered (_(" Total memory used for BFD obstack: %d\n"),
|
->objfile_obstack)));
|
||||||
obstack_memory_used (&objfile->per_bfd->storage_obstack));
|
printf_filtered (_(" Total memory used for BFD obstack: %s\n"),
|
||||||
|
pulongest (obstack_memory_used (&objfile->per_bfd
|
||||||
|
->storage_obstack)));
|
||||||
printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
|
printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
|
||||||
bcache_memory_used (psymbol_bcache_get_bcache
|
bcache_memory_used (psymbol_bcache_get_bcache
|
||||||
(objfile->psymbol_cache)));
|
(objfile->psymbol_cache)));
|
||||||
|
|
|
@ -3080,7 +3080,7 @@ gdb_sign_extend (LONGEST value, int bit)
|
||||||
void *
|
void *
|
||||||
hashtab_obstack_allocate (void *data, size_t size, size_t count)
|
hashtab_obstack_allocate (void *data, size_t size, size_t count)
|
||||||
{
|
{
|
||||||
unsigned int total = size * count;
|
size_t total = size * count;
|
||||||
void *ptr = obstack_alloc ((struct obstack *) data, total);
|
void *ptr = obstack_alloc ((struct obstack *) data, total);
|
||||||
|
|
||||||
memset (ptr, 0, total);
|
memset (ptr, 0, total);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue