bfd *abfd; struct section_addr_info *orig_addrs;
struct section_addr_info *orig_addrs = NULL;
symbol_file_add_with_addrs_or_offsets (char *name, int from_tty,                                       struct section_addr_info *addrs,                                       struct section_offsets *offsets,                                       int num_offsets,                                       int mainline, int flags){  struct objfile *objfile;  struct partial_symtab *psymtab;  char *debugfile;  bfd *abfd;  struct section_addr_info *orig_addrs;  struct cleanup *my_cleanups;  /* Open a bfd for the file, and give user a chance to burp if we'd be     interactively wiping out any existing symbols.  */  abfd = symfile_bfd_open (name);  if ((have_full_symbols () || have_partial_symbols ())      && mainline      && from_tty      && !query ("Load new symbol table from \"%s\"? ", name))    error ("Not confirmed.");  objfile = allocate_objfile (abfd, flags);  orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd));  my_cleanups = make_cleanup (xfree, orig_addrs);  if (addrs)    {      int i;      orig_addrs->num_sections = addrs->num_sections;      for (i = 0; i < addrs->num_sections; i++)	orig_addrs->other[i] = addrs->other[i];    }  /* We either created a new mapped symbol table, mapped an existing     symbol table file which has not had initial symbol reading     performed, or need to read an unmapped symbol table. */  if (from_tty || info_verbose)    {      if (pre_add_symbol_hook)	pre_add_symbol_hook (name);      else	{	  printf_unfiltered ("Reading symbols from %s...", name);	  wrap_here ("");	  gdb_flush (gdb_stdout);	}    }  syms_from_objfile (objfile, addrs, offsets, num_offsets,		     mainline, from_tty);  /* We now have at least a partial symbol table.  Check to see if the     user requested that all symbols be read on initial access via either     the gdb startup command line or on a per symbol file basis.  Expand     all partial symbol tables for this objfile if so. */  if ((flags & OBJF_READNOW) || readnow_symbol_files)    {      if (from_tty || info_verbose)	{	  printf_unfiltered ("expanding to full symbols...");	  wrap_here ("");	  gdb_flush (gdb_stdout);	}      for (psymtab = objfile->psymtabs;	   psymtab != NULL;	   psymtab = psymtab->next)	{	  psymtab_to_symtab (psymtab);	}    }  debugfile = find_separate_debug_file (objfile);  if (debugfile)    {      if (addrs != NULL)	{	  objfile->separate_debug_objfile            = symbol_file_add (debugfile, from_tty, orig_addrs, 0, flags);	}      else	{	  objfile->separate_debug_objfile            = symbol_file_add (debugfile, from_tty, NULL, 0, flags);	}      objfile->separate_debug_objfile->separate_debug_objfile_backlink        = objfile;            /* Put the separate debug object before the normal one, this is so that         usage of the ALL_OBJFILES_SAFE macro will stay safe. */      put_objfile_before (objfile->separate_debug_objfile, objfile);            xfree (debugfile);    }    if (!have_partial_symbols () && !have_full_symbols ())    {      wrap_here ("");      printf_unfiltered ("(no debugging symbols found)...");      wrap_here ("");    }  if (from_tty || info_verbose)    {      if (post_add_symbol_hook)	post_add_symbol_hook ();      else	{	  printf_unfiltered ("done.\n");	}    }  /* We print some messages regardless of whether 'from_tty ||     info_verbose' is true, so make sure they go out at the right     time.  */  gdb_flush (gdb_stdout);  do_cleanups (my_cleanups);  if (objfile->sf == NULL)    return objfile;	/* No symbols. */  new_symfile_objfile (objfile, mainline, from_tty);  if (target_new_objfile_hook)    target_new_objfile_hook (objfile);  return (objfile);}