/* Read HP PA/Risc object files for GDB.
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
+ Copyright (C) 1991-2014 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
This file is part of GDB.
#include "stabsread.h"
#include "gdb-stabs.h"
#include "complaints.h"
-#include "gdb_string.h"
+#include <string.h>
#include "demangle.h"
#include "som.h"
#include "libhppa.h"
som_symtab_read (bfd *abfd, struct objfile *objfile,
struct section_offsets *section_offsets)
{
+ struct cleanup *cleanup;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
unsigned int number_of_symbols;
int val, dynamic;
asection *shlib_info;
struct som_external_symbol_dictionary_record *buf, *bufp, *endbufp;
char *symname;
- CONST int symsize = sizeof (struct som_external_symbol_dictionary_record);
+ const int symsize = sizeof (struct som_external_symbol_dictionary_record);
#define text_offset ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile))
We avoid using alloca because the memory size could be so large
that we could hit the stack size limit. */
buf = xmalloc (symsize * number_of_symbols);
- make_cleanup (xfree, buf);
+ cleanup = make_cleanup (xfree, buf);
bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET);
val = bfd_bread (buf, symsize * number_of_symbols, abfd);
if (val != symsize * number_of_symbols)
section),
objfile);
}
+
+ do_cleanups (cleanup);
}
/* Scan and build partial symbols for a symbol file.
static const struct sym_fns som_sym_fns =
{
- bfd_target_som_flavour,
som_new_init, /* init anything gbl to entire symtab */
som_symfile_init, /* read initial info, setup for sym_read() */
som_symfile_read, /* read a symbol file into symtab */
void
_initialize_somread (void)
{
- add_symtab_fns (&som_sym_fns);
+ add_symtab_fns (bfd_target_som_flavour, &som_sym_fns);
}