This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] symfile.c whitespace tweaks


OK Elena?

2005-01-13  Michael Snyder  <msnyder@redhat.com>

	* symfile.c: Whitespace tweaks.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.144
diff -p -r1.144 symfile.c
*** symfile.c	23 Oct 2004 16:18:09 -0000	1.144
--- symfile.c	14 Jan 2005 04:43:33 -0000
***************
*** 60,71 ****
  #define O_BINARY 0
  #endif
  
! int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
  void (*deprecated_show_load_progress) (const char *section,
! 			    unsigned long section_sent,
! 			    unsigned long section_size,
! 			    unsigned long total_sent,
! 			    unsigned long total_size);
  void (*deprecated_pre_add_symbol_hook) (const char *);
  void (*deprecated_post_add_symbol_hook) (void);
  void (*deprecated_target_new_objfile_hook) (struct objfile *);
--- 60,72 ----
  #define O_BINARY 0
  #endif
  
! int (*deprecated_ui_load_progress_hook) (const char *section, 
! 					 unsigned long num);
  void (*deprecated_show_load_progress) (const char *section,
! 				       unsigned long section_sent,
! 				       unsigned long section_size,
! 				       unsigned long total_sent,
! 				       unsigned long total_size);
  void (*deprecated_pre_add_symbol_hook) (const char *);
  void (*deprecated_post_add_symbol_hook) (void);
  void (*deprecated_target_new_objfile_hook) (struct objfile *);
*************** static void clear_symtab_users_cleanup (
*** 75,81 ****
  /* Global variables owned by this file */
  int readnow_symbol_files;	/* Read full symbols immediately */
  
! /* External variables and functions referenced. */
  
  extern void report_transfer_performance (unsigned long, time_t, time_t);
  
--- 76,82 ----
  /* Global variables owned by this file */
  int readnow_symbol_files;	/* Read full symbols immediately */
  
! /* External variables and functions referenced.  */
  
  extern void report_transfer_performance (unsigned long, time_t, time_t);
  
*************** void _initialize_symfile (void);
*** 150,156 ****
  
  /* List of all available sym_fns.  On gdb startup, each object file reader
     calls add_symtab_fns() to register information on each format it is
!    prepared to read. */
  
  static struct sym_fns *symtab_fns = NULL;
  
--- 151,157 ----
  
  /* List of all available sym_fns.  On gdb startup, each object file reader
     calls add_symtab_fns() to register information on each format it is
!    prepared to read.  */
  
  static struct sym_fns *symtab_fns = NULL;
  
*************** int symbol_reloading = 0;
*** 171,177 ****
     this flag and then add the shared library symbols as needed.  Note
     that there is a potential for confusion, since if the shared
     library symbols are not loaded, commands like "info fun" will *not*
!    report all the functions that are actually present. */
  
  int auto_solib_add = 1;
  
--- 172,178 ----
     this flag and then add the shared library symbols as needed.  Note
     that there is a potential for confusion, since if the shared
     library symbols are not loaded, commands like "info fun" will *not*
!    report all the functions that are actually present.  */
  
  int auto_solib_add = 1;
  
*************** int auto_solib_add = 1;
*** 181,187 ****
     size to exceed this threshhold, then the shlib's symbols are not
     added.  The threshold is ignored if the user explicitly asks for a
     shlib to be added, such as when using the "sharedlibrary"
!    command. */
  
  int auto_solib_limit;
  
--- 182,188 ----
     size to exceed this threshhold, then the shlib's symbols are not
     added.  The threshold is ignored if the user explicitly asks for a
     shlib to be added, such as when using the "sharedlibrary"
!    command.  */
  
  int auto_solib_limit;
  
*************** compare_psymbols (const void *s1p, const
*** 202,226 ****
  void
  sort_pst_symbols (struct partial_symtab *pst)
  {
!   /* Sort the global list; don't sort the static list */
  
    qsort (pst->objfile->global_psymbols.list + pst->globals_offset,
  	 pst->n_global_syms, sizeof (struct partial_symbol *),
  	 compare_psymbols);
  }
  
! /* Make a null terminated copy of the string at PTR with SIZE characters in
!    the obstack pointed to by OBSTACKP .  Returns the address of the copy.
!    Note that the string at PTR does not have to be null terminated, I.E. it
!    may be part of a larger string and we are only saving a substring. */
  
  char *
  obsavestring (const char *ptr, int size, struct obstack *obstackp)
  {
    char *p = (char *) obstack_alloc (obstackp, size + 1);
!   /* Open-coded memcpy--saves function call time.  These strings are usually
!      short.  FIXME: Is this really still true with a compiler that can
!      inline memcpy? */
    {
      const char *p1 = ptr;
      char *p2 = p;
--- 203,228 ----
  void
  sort_pst_symbols (struct partial_symtab *pst)
  {
!   /* Sort the global list; don't sort the static list.  */
  
    qsort (pst->objfile->global_psymbols.list + pst->globals_offset,
  	 pst->n_global_syms, sizeof (struct partial_symbol *),
  	 compare_psymbols);
  }
  
! /* Make a null terminated copy of the string at PTR with SIZE
!    characters in the obstack pointed to by OBSTACKP .  Returns the
!    address of the copy.  Note that the string at PTR does not have to
!    be null terminated, I.E. it may be part of a larger string and we
!    are only saving a substring.  */
  
  char *
  obsavestring (const char *ptr, int size, struct obstack *obstackp)
  {
    char *p = (char *) obstack_alloc (obstackp, size + 1);
!   /* Open-coded memcpy--saves function call time.  These strings are
!      usually short.  FIXME: Is this really still true with a compiler
!      that can inline memcpy? */
    {
      const char *p1 = ptr;
      char *p2 = p;
*************** obsavestring (const char *ptr, int size,
*** 232,239 ****
    return p;
  }
  
! /* Concatenate strings S1, S2 and S3; return the new string.  Space is found
!    in the obstack pointed to by OBSTACKP.  */
  
  char *
  obconcat (struct obstack *obstackp, const char *s1, const char *s2,
--- 234,241 ----
    return p;
  }
  
! /* Concatenate strings S1, S2 and S3; return the new string.
!    Space is found in the obstack pointed to by OBSTACKP.  */
  
  char *
  obconcat (struct obstack *obstackp, const char *s1, const char *s2,
*************** obconcat (struct obstack *obstackp, cons
*** 247,253 ****
    return val;
  }
  
! /* True if we are nested inside psymtab_to_symtab. */
  
  int currently_reading_symtab = 0;
  
--- 249,255 ----
    return val;
  }
  
! /* True if we are nested inside psymtab_to_symtab.  */
  
  int currently_reading_symtab = 0;
  
*************** decrement_reading_symtab (void *dummy)
*** 265,271 ****
  struct symtab *
  psymtab_to_symtab (struct partial_symtab *pst)
  {
!   /* If it's been looked up before, return it. */
    if (pst->symtab)
      return pst->symtab;
  
--- 267,273 ----
  struct symtab *
  psymtab_to_symtab (struct partial_symtab *pst)
  {
!   /* If it's been looked up before, return it.  */
    if (pst->symtab)
      return pst->symtab;
  
*************** copy_section_addr_info (struct section_a
*** 351,357 ****
  
  
  /* Build (allocate and populate) a section_addr_info struct from
!    an existing section table. */
  
  extern struct section_addr_info *
  build_section_addr_info_from_section_table (const struct section_table *start,
--- 353,359 ----
  
  
  /* Build (allocate and populate) a section_addr_info struct from
!    an existing section table.  */
  
  extern struct section_addr_info *
  build_section_addr_info_from_section_table (const struct section_table *start,
*************** build_section_addr_info_from_section_tab
*** 381,387 ****
  }
  
  
! /* Free all memory allocated by build_section_addr_info_from_section_table. */
  
  extern void
  free_section_addr_info (struct section_addr_info *sap)
--- 383,389 ----
  }
  
  
! /* Free all memory allocated by build_section_addr_info_from_section_table.  */
  
  extern void
  free_section_addr_info (struct section_addr_info *sap)
*************** init_objfile_sect_indices (struct objfil
*** 426,432 ****
       doesn't matter which slot in section_offsets the individual
       sect_index_* members index into.  So if they are all zero, it is
       safe to just point all the currently uninitialized indices to the
!      first slot. */
  
    for (i = 0; i < objfile->num_sections; i++)
      {
--- 428,434 ----
       doesn't matter which slot in section_offsets the individual
       sect_index_* members index into.  So if they are all zero, it is
       safe to just point all the currently uninitialized indices to the
!      first slot.  */
  
    for (i = 0; i < objfile->num_sections; i++)
      {
*************** default_symfile_offsets (struct objfile 
*** 469,475 ****
  	  SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
  
    /* Now calculate offsets for section that were specified by the
!      caller. */
    for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
      {
        struct other_sections *osp ;
--- 471,477 ----
  	  SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
  
    /* Now calculate offsets for section that were specified by the
!      caller.  */
    for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
      {
        struct other_sections *osp ;
*************** default_symfile_offsets (struct objfile 
*** 480,491 ****
  
        /* Record all sections in offsets */
        /* The section_offsets in the objfile are here filled in using
!          the BFD index. */
        (objfile->section_offsets)->offsets[osp->sectindex] = osp->addr;
      }
  
    /* Remember the bfd indexes for the .text, .data, .bss and
!      .rodata sections. */
    init_objfile_sect_indices (objfile);
  }
  
--- 482,493 ----
  
        /* Record all sections in offsets */
        /* The section_offsets in the objfile are here filled in using
!          the BFD index.  */
        (objfile->section_offsets)->offsets[osp->sectindex] = osp->addr;
      }
  
    /* Remember the bfd indexes for the .text, .data, .bss and
!      .rodata sections.  */
    init_objfile_sect_indices (objfile);
  }
  
*************** syms_from_objfile (struct objfile *objfi
*** 539,553 ****
    find_sym_fns (objfile);
  
    if (objfile->sf == NULL)
!     return;	/* No symbols. */
  
!   /* Make sure that partially constructed symbol tables will be cleaned up
!      if an error occurs during symbol reading.  */
    old_chain = make_cleanup_free_objfile (objfile);
  
    /* If ADDRS and OFFSETS are both NULL, put together a dummy address
       list.  We now establish the convention that an addr of zero means
!      no load address was specified. */
    if (! addrs && ! offsets)
      {
        local_addr
--- 541,555 ----
    find_sym_fns (objfile);
  
    if (objfile->sf == NULL)
!     return;	/* No symbols.  */
  
!   /* Make sure that partially constructed symbol tables will be
!      cleaned up if an error occurs during symbol reading.  */
    old_chain = make_cleanup_free_objfile (objfile);
  
    /* If ADDRS and OFFSETS are both NULL, put together a dummy address
       list.  We now establish the convention that an addr of zero means
!      no load address was specified.  */
    if (! addrs && ! offsets)
      {
        local_addr
*************** syms_from_objfile (struct objfile *objfi
*** 584,591 ****
       We find the lowest address of a loaded segment in the objfile,
       and assume that <addr> is where that got loaded.
  
!      We no longer warn if the lowest section is not a text segment (as
!      happens for the PA64 port.  */
    if (!mainline && addrs && addrs->other[0].name)
      {
        asection *lower_sect;
--- 586,593 ----
       We find the lowest address of a loaded segment in the objfile,
       and assume that <addr> is where that got loaded.
  
!      We no longer warn if the lowest section is not a text segment
!      (as happens for the PA64 port.  */
    if (!mainline && addrs && addrs->other[0].name)
      {
        asection *lower_sect;
*************** syms_from_objfile (struct objfile *objfi
*** 595,601 ****
  
        /* Find lowest loadable section to be used as starting point for
           continguous sections. FIXME!! won't work without call to find
! 	 .text first, but this assumes text is lowest section. */
        lower_sect = bfd_get_section_by_name (objfile->obfd, ".text");
        if (lower_sect == NULL)
  	bfd_map_over_sections (objfile->obfd, find_lowest_section,
--- 597,603 ----
  
        /* Find lowest loadable section to be used as starting point for
           continguous sections. FIXME!! won't work without call to find
! 	 .text first, but this assumes text is lowest section.  */
        lower_sect = bfd_get_section_by_name (objfile->obfd, ".text");
        if (lower_sect == NULL)
  	bfd_map_over_sections (objfile->obfd, find_lowest_section,
*************** syms_from_objfile (struct objfile *objfi
*** 604,610 ****
  	warning ("no loadable sections found in added symbol-file %s",
  		 objfile->name);
        else
! 	if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0)
  	  warning ("Lowest section in %s is %s at %s",
  		   objfile->name,
  		   bfd_section_name (objfile->obfd, lower_sect),
--- 606,613 ----
  	warning ("no loadable sections found in added symbol-file %s",
  		 objfile->name);
        else
! 	if ((bfd_get_section_flags (objfile->obfd, 
! 				    lower_sect) & SEC_CODE) == 0)
  	  warning ("Lowest section in %s is %s at %s",
  		   objfile->name,
  		   bfd_section_name (objfile->obfd, lower_sect),
*************** syms_from_objfile (struct objfile *objfi
*** 635,641 ****
                      addrs->other[i].addr
                        -= bfd_section_vma (objfile->obfd, sect);
                      lower_offset = addrs->other[i].addr;
!                     /* This is the index used by BFD. */
                      addrs->other[i].sectindex = sect->index ;
                    }
                  else
--- 638,644 ----
                      addrs->other[i].addr
                        -= bfd_section_vma (objfile->obfd, sect);
                      lower_offset = addrs->other[i].addr;
!                     /* This is the index used by BFD.  */
                      addrs->other[i].sectindex = sect->index ;
                    }
                  else
*************** syms_from_objfile (struct objfile *objfi
*** 651,659 ****
            }
      }
  
!   /* Initialize symbol reading routines for this objfile, allow complaints to
!      appear for this new file, and record how verbose to be, then do the
!      initial symbol reading for this file. */
  
    (*objfile->sf->sym_init) (objfile);
    clear_complaints (&symfile_complaints, 1, verbo);
--- 654,662 ----
            }
      }
  
!   /* Initialize symbol reading routines for this objfile, allow
!      complaints to appear for this new file, and record how verbose
!      to be, then do the initial symbol reading for this file.  */
  
    (*objfile->sf->sym_init) (objfile);
    clear_complaints (&symfile_complaints, 1, verbo);
*************** syms_from_objfile (struct objfile *objfi
*** 700,706 ****
   	/* Map section offsets in "addr" back to the object's
   	   sections by comparing the section names with bfd's
   	   section names.  Then adjust the section address by
!  	   the offset. */ /* for gdb/13815 */
  
        ALL_OBJFILE_OSECTIONS (objfile, s)
  	{
--- 703,709 ----
   	/* Map section offsets in "addr" back to the object's
   	   sections by comparing the section names with bfd's
   	   section names.  Then adjust the section address by
!  	   the offset.  */ /* for gdb/13815 */
  
        ALL_OBJFILE_OSECTIONS (objfile, s)
  	{
*************** syms_from_objfile (struct objfile *objfi
*** 734,741 ****
    TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
    TYPE_NAME (lookup_pointer_type (builtin_type_void)) = 0;
  
!   /* Mark the objfile has having had initial symbol read attempted.  Note
!      that this does not mean we found any symbols... */
  
    objfile->flags |= OBJF_SYMS;
  
--- 737,744 ----
    TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
    TYPE_NAME (lookup_pointer_type (builtin_type_void)) = 0;
  
!   /* Mark the objfile has having had initial symbol read attempted. 
!      Note that this does not mean we found any symbols...  */
  
    objfile->flags |= OBJF_SYMS;
  
*************** syms_from_objfile (struct objfile *objfi
*** 745,752 ****
  }
  
  /* Perform required actions after either reading in the initial
!    symbols for a new objfile, or mapping in the symbols from a reusable
!    objfile. */
  
  void
  new_symfile_objfile (struct objfile *objfile, int mainline, int verbo)
--- 748,755 ----
  }
  
  /* Perform required actions after either reading in the initial
!    symbols for a new objfile, or mapping in the symbols from a
!    reusable objfile.  */
  
  void
  new_symfile_objfile (struct objfile *objfile, int mainline, int verbo)
*************** new_symfile_objfile (struct objfile *obj
*** 775,781 ****
     loaded file.
  
     ABFD is a BFD already open on the file, as from symfile_bfd_open.
!    This BFD will be closed on error, and is always consumed by this function.
  
     FROM_TTY says how verbose to be.
  
--- 778,785 ----
     loaded file.
  
     ABFD is a BFD already open on the file, as from symfile_bfd_open.
!    This BFD will be closed on error, and is always consumed by this
!    function.
  
     FROM_TTY says how verbose to be.
  
*************** new_symfile_objfile (struct objfile *obj
*** 787,793 ****
     non-zero.
  
     Upon success, returns a pointer to the objfile that was added.
!    Upon failure, jumps back to command level (never returns). */
  static struct objfile *
  symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
                                         struct section_addr_info *addrs,
--- 791,797 ----
     non-zero.
  
     Upon success, returns a pointer to the objfile that was added.
!    Upon failure, jumps back to command level (never returns).  */
  static struct objfile *
  symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
                                         struct section_addr_info *addrs,
*************** symbol_file_add_with_addrs_or_offsets (b
*** 824,830 ****
  
    /* 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 (deprecated_pre_add_symbol_hook)
--- 828,834 ----
  
    /* 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 (deprecated_pre_add_symbol_hook)
*************** symbol_file_add_with_addrs_or_offsets (b
*** 842,848 ****
    /* 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)
      {
--- 846,852 ----
    /* 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)
      {
*************** symbol_file_add_with_addrs_or_offsets (b
*** 877,884 ****
        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);
--- 881,888 ----
        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);
*************** symbol_file_add_with_addrs_or_offsets (b
*** 913,919 ****
    do_cleanups (my_cleanups);
  
    if (objfile->sf == NULL)
!     return objfile;	/* No symbols. */
  
    new_symfile_objfile (objfile, mainline, from_tty);
  
--- 917,923 ----
    do_cleanups (my_cleanups);
  
    if (objfile->sf == NULL)
!     return objfile;	/* No symbols.  */
  
    new_symfile_objfile (objfile, mainline, from_tty);
  
*************** symbol_file_add_from_bfd (bfd *abfd, int
*** 935,942 ****
                            struct section_addr_info *addrs,
                            int mainline, int flags)
  {
!   return symbol_file_add_with_addrs_or_offsets (abfd,
! 						from_tty, addrs, 0, 0,
                                                  mainline, flags);
  }
  
--- 939,946 ----
                            struct section_addr_info *addrs,
                            int mainline, int flags)
  {
!   return symbol_file_add_with_addrs_or_offsets (abfd, from_tty,
! 						addrs, 0, 0,
                                                  mainline, flags);
  }
  
*************** symbol_file_add_from_bfd (bfd *abfd, int
*** 945,951 ****
     loaded file.  See symbol_file_add_with_addrs_or_offsets's comments
     for details.  */
  struct objfile *
! symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
  		 int mainline, int flags)
  {
    return symbol_file_add_from_bfd (symfile_bfd_open (name), from_tty,
--- 949,956 ----
     loaded file.  See symbol_file_add_with_addrs_or_offsets's comments
     for details.  */
  struct objfile *
! symbol_file_add (char *name, int from_tty, 
! 		 struct section_addr_info *addrs,
  		 int mainline, int flags)
  {
    return symbol_file_add_from_bfd (symfile_bfd_open (name), from_tty,
*************** symbol_file_add (char *name, int from_tt
*** 958,965 ****
     Used when the file is supplied in the gdb command line
     and by some targets with special loading requirements.
     The auxiliary function, symbol_file_add_main_1(), has the flags
!    argument for the switches that can only be specified in the symbol_file
!    command itself.  */
  
  void
  symbol_file_add_main (char *args, int from_tty)
--- 963,970 ----
     Used when the file is supplied in the gdb command line
     and by some targets with special loading requirements.
     The auxiliary function, symbol_file_add_main_1(), has the flags
!    argument for the switches that can only be specified in the
!    symbol_file command itself.  */
  
  void
  symbol_file_add_main (char *args, int from_tty)
*************** symbol_file_clear (int from_tty)
*** 989,995 ****
      error ("Not confirmed.");
      free_all_objfiles ();
  
!     /* solib descriptors may have handles to objfiles.  Since their
         storage has just been released, we'd better wipe the solib
         descriptors as well.
       */
--- 994,1000 ----
      error ("Not confirmed.");
      free_all_objfiles ();
  
!     /* Solib descriptors may have handles to objfiles.  Since their
         storage has just been released, we'd better wipe the solib
         descriptors as well.
       */
*************** get_debug_link_info (struct objfile *obj
*** 1021,1029 ****
  
    contents = xmalloc (debuglink_size);
    bfd_get_section_contents (objfile->obfd, sect, contents,
! 			    (file_ptr)0, (bfd_size_type)debuglink_size);
  
!   /* Crc value is stored after the filename, aligned up to 4 bytes. */
    crc_offset = strlen (contents) + 1;
    crc_offset = (crc_offset + 3) & ~3;
  
--- 1026,1034 ----
  
    contents = xmalloc (debuglink_size);
    bfd_get_section_contents (objfile->obfd, sect, contents,
! 			    (file_ptr) 0, (bfd_size_type)debuglink_size);
  
!   /* Crc value is stored after the filename, aligned up to 4 bytes.  */
    crc_offset = strlen (contents) + 1;
    crc_offset = (crc_offset + 3) & ~3;
  
*************** find_separate_debug_file (struct objfile
*** 1152,1158 ****
  /* Note: ezannoni 2000-04-17. This function used to have support for
     rombug (see remote-os9k.c). It consisted of a call to target_link()
     (target.c) to get the address of the text segment from the target,
!    and pass that to symbol_file_add(). This is no longer supported. */
  
  void
  symbol_file_command (char *args, int from_tty)
--- 1157,1163 ----
  /* Note: ezannoni 2000-04-17. This function used to have support for
     rombug (see remote-os9k.c). It consisted of a call to target_link()
     (target.c) to get the address of the text segment from the target,
!    and pass that to symbol_file_add(). This is no longer supported.  */
  
  void
  symbol_file_command (char *args, int from_tty)
*************** symbol_file_command (char *args, int fro
*** 1200,1211 ****
  
  /* Set the initial language.
  
!    A better solution would be to record the language in the psymtab when reading
!    partial symbols, and then use it (if known) to set the language.  This would
!    be a win for formats that encode the language in an easily discoverable place,
!    such as DWARF.  For stabs, we can jump through hoops looking for specially
!    named symbols or try to intuit the language from the specific type of stabs
!    we find, but we can't do that until later when we read in full symbols.
     FIXME.  */
  
  static void
--- 1205,1217 ----
  
  /* Set the initial language.
  
!    A better solution would be to record the language in the psymtab
!    when reading partial symbols, and then use it (if known) to set the
!    language.  This would be a win for formats that encode the language
!    in an easily discoverable place, such as DWARF.  For stabs, we can
!    jump through hoops looking for specially named symbols or try to
!    intuit the language from the specific type of stabs we find, but we
!    can't do that until later when we read in full symbols.  
     FIXME.  */
  
  static void
*************** set_initial_language (void)
*** 1227,1233 ****
  	  lang = language_c;
  	}
        set_language (lang);
!       expected_language = current_language;	/* Don't warn the user */
      }
  }
  
--- 1233,1239 ----
  	  lang = language_c;
  	}
        set_language (lang);
!       expected_language = current_language;	/* Don't warn the user.  */
      }
  }
  
*************** symfile_bfd_open (char *name)
*** 1245,1255 ****
  
  
  
!   name = tilde_expand (name);	/* Returns 1st new malloc'd copy */
  
    /* Look down path for it, allocate 2nd new malloc'd copy.  */
!   desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, name, O_RDONLY | O_BINARY,
! 		0, &absolute_name);
  #if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
    if (desc < 0)
      {
--- 1251,1261 ----
  
  
  
!   name = tilde_expand (name);	/* Returns 1st new malloc'd copy.  */
  
    /* Look down path for it, allocate 2nd new malloc'd copy.  */
!   desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, name,
! 		O_RDONLY | O_BINARY, 0, &absolute_name);
  #if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
    if (desc < 0)
      {
*************** symfile_bfd_open (char *name)
*** 1264,1272 ****
        make_cleanup (xfree, name);
        perror_with_name (name);
      }
!   xfree (name);			/* Free 1st new malloc'd copy */
!   name = absolute_name;		/* Keep 2nd malloc'd copy in bfd */
!   /* It'll be freed in free_objfile(). */
  
    sym_bfd = bfd_fdopenr (name, gnutarget, desc);
    if (!sym_bfd)
--- 1270,1278 ----
        make_cleanup (xfree, name);
        perror_with_name (name);
      }
!   xfree (name);			/* Free 1st new malloc'd copy.  */
!   name = absolute_name;		/* Keep 2nd malloc'd copy in bfd.  */
!   /* It'll be freed in free_objfile().  */
  
    sym_bfd = bfd_fdopenr (name, gnutarget, desc);
    if (!sym_bfd)
*************** symfile_bfd_open (char *name)
*** 1280,1288 ****
  
    if (!bfd_check_format (sym_bfd, bfd_object))
      {
!       /* FIXME: should be checking for errors from bfd_close (for one thing,
!          on error it does not free all the storage associated with the
!          bfd).  */
        bfd_close (sym_bfd);	/* This also closes desc */
        make_cleanup (xfree, name);
        error ("\"%s\": can't read symbols: %s.", name,
--- 1286,1294 ----
  
    if (!bfd_check_format (sym_bfd, bfd_object))
      {
!       /* FIXME: should be checking for errors from bfd_close (for one
!          thing, on error it does not free all the storage associated
!          with the bfd).  */
        bfd_close (sym_bfd);	/* This also closes desc */
        make_cleanup (xfree, name);
        error ("\"%s\": can't read symbols: %s.", name,
*************** symfile_bfd_open (char *name)
*** 1292,1298 ****
  }
  
  /* Return the section index for the given section name. Return -1 if
!    the section was not found. */
  int
  get_section_index (struct objfile *objfile, char *section_name)
  {
--- 1298,1304 ----
  }
  
  /* Return the section index for the given section name. Return -1 if
!    the section was not found.  */
  int
  get_section_index (struct objfile *objfile, char *section_name)
  {
*************** get_section_index (struct objfile *objfi
*** 1306,1312 ****
  /* Link a new symtab_fns into the global symtab_fns list.  Called on gdb
     startup by the _initialize routine in each object file format reader,
     to register information about each format the the reader is prepared
!    to handle. */
  
  void
  add_symtab_fns (struct sym_fns *sf)
--- 1312,1318 ----
  /* Link a new symtab_fns into the global symtab_fns list.  Called on gdb
     startup by the _initialize routine in each object file format reader,
     to register information about each format the the reader is prepared
!    to handle.  */
  
  void
  add_symtab_fns (struct sym_fns *sf)
*************** find_sym_fns (struct objfile *objfile)
*** 1331,1337 ****
    if (our_flavour == bfd_target_srec_flavour
        || our_flavour == bfd_target_ihex_flavour
        || our_flavour == bfd_target_tekhex_flavour)
!     return;	/* No symbols. */
  
    for (sf = symtab_fns; sf != NULL; sf = sf->next)
      {
--- 1337,1343 ----
    if (our_flavour == bfd_target_srec_flavour
        || our_flavour == bfd_target_ihex_flavour
        || our_flavour == bfd_target_tekhex_flavour)
!     return;	/* No symbols.  */
  
    for (sf = symtab_fns; sf != NULL; sf = sf->next)
      {
*************** load_section_callback (bfd *abfd, asecti
*** 1417,1425 ****
  	  buffer = xmalloc (size);
  	  old_chain = make_cleanup (xfree, buffer);
  
! 	  /* Is this really necessary?  I guess it gives the user something
! 	     to look at during a long download.  */
! 	  ui_out_message (uiout, 0, "Loading section %s, size 0x%s lma 0x%s\n",
  			  sect_name, paddr_nz (size), paddr_nz (lma));
  
  	  bfd_get_section_contents (abfd, asec, buffer, 0, size);
--- 1423,1432 ----
  	  buffer = xmalloc (size);
  	  old_chain = make_cleanup (xfree, buffer);
  
! 	  /* Is this really necessary?  I guess it gives the user
! 	     something to look at during a long download.  */
! 	  ui_out_message (uiout, 0, 
! 			  "Loading section %s, size 0x%s lma 0x%s\n",
  			  sect_name, paddr_nz (size), paddr_nz (lma));
  
  	  bfd_get_section_contents (abfd, asec, buffer, 0, size);
*************** load_section_callback (bfd *abfd, asecti
*** 1465,1471 ****
  	      sent += len;
  	      if (quit_flag
  		  || (deprecated_ui_load_progress_hook != NULL
! 		      && deprecated_ui_load_progress_hook (sect_name, sent)))
  		error ("Canceled the download");
  
  	      if (deprecated_show_load_progress != NULL)
--- 1472,1479 ----
  	      sent += len;
  	      if (quit_flag
  		  || (deprecated_ui_load_progress_hook != NULL
! 		      && deprecated_ui_load_progress_hook (sect_name, 
! 							   sent)))
  		error ("Canceled the download");
  
  	      if (deprecated_show_load_progress != NULL)
*************** load_section_callback (bfd *abfd, asecti
*** 1476,1482 ****
  	  while (sent < size);
  
  	  if (err != 0)
! 	    error ("Memory access error while loading section %s.", sect_name);
  
  	  do_cleanups (old_chain);
  	}
--- 1484,1491 ----
  	  while (sent < size);
  
  	  if (err != 0)
! 	    error ("Memory access error while loading section %s.", 
! 		   sect_name);
  
  	  do_cleanups (old_chain);
  	}
*************** generic_load (char *args, int from_tty)
*** 1495,1507 ****
    struct load_section_data cbdata;
    CORE_ADDR entry;
  
!   cbdata.load_offset = 0;	/* Offset to add to vma for each section. */
!   cbdata.write_count = 0;	/* Number of writes needed. */
!   cbdata.data_count = 0;	/* Number of bytes written to target memory. */
!   cbdata.total_size = 0;	/* Total size of all bfd sectors. */
  
    /* Parse the input argument - the user can specify a load offset as
!      a second argument. */
    filename = xmalloc (strlen (args) + 1);
    old_cleanups = make_cleanup (xfree, filename);
    strcpy (filename, args);
--- 1504,1516 ----
    struct load_section_data cbdata;
    CORE_ADDR entry;
  
!   cbdata.load_offset = 0;	/* Offset to add to vma for each section.  */
!   cbdata.write_count = 0;	/* Number of writes needed.  */
!   cbdata.data_count = 0;	/* Number of bytes written to target memory.  */
!   cbdata.total_size = 0;	/* Total size of all bfd sectors.  */
  
    /* Parse the input argument - the user can specify a load offset as
!      a second argument.  */
    filename = xmalloc (strlen (args) + 1);
    old_cleanups = make_cleanup (xfree, filename);
    strcpy (filename, args);
*************** generic_load (char *args, int from_tty)
*** 1518,1524 ****
    else
      cbdata.load_offset = 0;
  
!   /* Open the file for loading. */
    loadfile_bfd = bfd_openr (filename, gnutarget);
    if (loadfile_bfd == NULL)
      {
--- 1527,1533 ----
    else
      cbdata.load_offset = 0;
  
!   /* Open the file for loading.  */
    loadfile_bfd = bfd_openr (filename, gnutarget);
    if (loadfile_bfd == NULL)
      {
*************** generic_load (char *args, int from_tty)
*** 1568,1582 ****
    do_cleanups (old_cleanups);
  }
  
! /* Report how fast the transfer went. */
  
  /* DEPRECATED: cagney/1999-10-18: report_transfer_performance is being
     replaced by print_transfer_performance (with a very different
!    function signature). */
  
  void
! report_transfer_performance (unsigned long data_count, time_t start_time,
! 			     time_t end_time)
  {
    print_transfer_performance (gdb_stdout, data_count,
  			      end_time - start_time, 0);
--- 1577,1591 ----
    do_cleanups (old_cleanups);
  }
  
! /* Report how fast the transfer went.  */
  
  /* DEPRECATED: cagney/1999-10-18: report_transfer_performance is being
     replaced by print_transfer_performance (with a very different
!    function signature).  */
  
  void
! report_transfer_performance (unsigned long data_count,
! 			     time_t start_time, time_t end_time)
  {
    print_transfer_performance (gdb_stdout, data_count,
  			      end_time - start_time, 0);
*************** print_transfer_performance (struct ui_fi
*** 1597,1609 ****
      }
    else
      {
!       ui_out_field_fmt (uiout, "transferred-bits", "%lu", (data_count * 8));
        ui_out_text (uiout, " bits in <1 sec");
      }
    if (write_count > 0)
      {
        ui_out_text (uiout, ", ");
!       ui_out_field_fmt (uiout, "write-rate", "%lu", data_count / write_count);
        ui_out_text (uiout, " bytes/write");
      }
    ui_out_text (uiout, ".\n");
--- 1606,1620 ----
      }
    else
      {
!       ui_out_field_fmt (uiout, "transferred-bits", 
! 			"%lu", (data_count * 8));
        ui_out_text (uiout, " bits in <1 sec");
      }
    if (write_count > 0)
      {
        ui_out_text (uiout, ", ");
!       ui_out_field_fmt (uiout, "write-rate", "%lu", 
! 			data_count / write_count);
        ui_out_text (uiout, " bytes/write");
      }
    ui_out_text (uiout, ".\n");
*************** print_transfer_performance (struct ui_fi
*** 1616,1622 ****
     monitor for Microware's OS-9 / OS-9000, see remote-os9k.c). In the
     rombug case, the user doesn't need to supply a text address,
     instead a call to target_link() (in target.c) would supply the
!    value to use. We are now discontinuing this type of ad hoc syntax. */
  
  static void
  add_symbol_file_command (char *args, int from_tty)
--- 1627,1633 ----
     monitor for Microware's OS-9 / OS-9000, see remote-os9k.c). In the
     rombug case, the user doesn't need to supply a text address,
     instead a call to target_link() (in target.c) would supply the
!    value to use. We are now discontinuing this type of ad hoc syntax.  */
  
  static void
  add_symbol_file_command (char *args, int from_tty)
*************** add_symbol_file_command (char *args, int
*** 1652,1658 ****
    if (args == NULL)
      error ("add-symbol-file takes a file name and an address");
  
!   /* Make a copy of the string that we can safely write into. */
    args = xstrdup (args);
  
    while (*args != '\000')
--- 1663,1669 ----
    if (args == NULL)
      error ("add-symbol-file takes a file name and an address");
  
!   /* Make a copy of the string that we can safely write into.  */
    args = xstrdup (args);
  
    while (*args != '\000')
*************** add_symbol_file_command (char *args, int
*** 1661,1682 ****
        while (isspace (*args))
  	args++;
  
!       /* Point arg to the beginning of the argument. */
        arg = args;
  
!       /* Move args pointer over the argument. */
        while ((*args != '\000') && !isspace (*args))
  	args++;
  
        /* If there are more arguments, terminate arg and
!          proceed past it. */
        if (*args != '\000')
  	*args++ = '\000';
  
!       /* Now process the argument. */
        if (argcnt == 0)
  	{
! 	  /* The first argument is the file name. */
  	  filename = tilde_expand (arg);
  	  make_cleanup (xfree, filename);
  	}
--- 1672,1693 ----
        while (isspace (*args))
  	args++;
  
!       /* Point arg to the beginning of the argument.  */
        arg = args;
  
!       /* Move args pointer over the argument.  */
        while ((*args != '\000') && !isspace (*args))
  	args++;
  
        /* If there are more arguments, terminate arg and
!          proceed past it.  */
        if (*args != '\000')
  	*args++ = '\000';
  
!       /* Now process the argument.  */
        if (argcnt == 0)
  	{
! 	  /* The first argument is the file name.  */
  	  filename = tilde_expand (arg);
  	  make_cleanup (xfree, filename);
  	}
*************** add_symbol_file_command (char *args, int
*** 1684,1690 ****
  	if (argcnt == 1)
  	  {
  	    /* The second argument is always the text address at which
!                to load the program. */
  	    sect_opts[section_index].name = ".text";
  	    sect_opts[section_index].value = arg;
  	    if (++section_index > num_sect_opts)
--- 1695,1701 ----
  	if (argcnt == 1)
  	  {
  	    /* The second argument is always the text address at which
!                to load the program.  */
  	    sect_opts[section_index].name = ".text";
  	    sect_opts[section_index].value = arg;
  	    if (++section_index > num_sect_opts)
*************** add_symbol_file_command (char *args, int
*** 1699,1705 ****
  	else
  	  {
  	    /* It's an option (starting with '-') or it's an argument
! 	       to an option */
  
  	    if (*arg == '-')
  	      {
--- 1710,1716 ----
  	else
  	  {
  	    /* It's an option (starting with '-') or it's an argument
! 	       to an option.  */
  
  	    if (*arg == '-')
  	      {
*************** add_symbol_file_command (char *args, int
*** 1743,1749 ****
       a sect_addr_info structure to be passed around to other
       functions.  We have to split this up into separate print
       statements because hex_string returns a local static
!      string. */
  
    printf_unfiltered ("add symbol table from file \"%s\" at\n", filename);
    section_addrs = alloc_section_addr_info (section_index);
--- 1754,1760 ----
       a sect_addr_info structure to be passed around to other
       functions.  We have to split this up into separate print
       statements because hex_string returns a local static
!      string.  */
  
    printf_unfiltered ("add symbol table from file \"%s\" at\n", filename);
    section_addrs = alloc_section_addr_info (section_index);
*************** add_symbol_file_command (char *args, int
*** 1757,1763 ****
        addr = parse_and_eval_address (val);
  
        /* Here we store the section offsets in the order they were
!          entered on the command line. */
        section_addrs->other[sec_num].name = sec;
        section_addrs->other[sec_num].addr = addr;
        printf_unfiltered ("\t%s_addr = %s\n",
--- 1768,1774 ----
        addr = parse_and_eval_address (val);
  
        /* Here we store the section offsets in the order they were
!          entered on the command line.  */
        section_addrs->other[sec_num].name = sec;
        section_addrs->other[sec_num].addr = addr;
        printf_unfiltered ("\t%s_addr = %s\n",
*************** reread_symbols (void)
*** 1806,1812 ****
       the load time should be saved in the partial symbol tables, since
       different tables may come from different source files.  FIXME.
       This routine should then walk down each partial symbol table
!      and see if the symbol table that it originates from has been changed */
  
    for (objfile = object_files; objfile; objfile = objfile->next)
      {
--- 1817,1824 ----
       the load time should be saved in the partial symbol tables, since
       different tables may come from different source files.  FIXME.
       This routine should then walk down each partial symbol table
!      and see if the symbol table that it originates from has been changed.
!   */
  
    for (objfile = object_files; objfile; objfile = objfile->next)
      {
*************** reread_symbols (void)
*** 1814,1820 ****
  	{
  #ifdef DEPRECATED_IBM6000_TARGET
  	  /* If this object is from a shared library, then you should
! 	     stat on the library name, not member name. */
  
  	  if (objfile->obfd->my_archive)
  	    res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
--- 1826,1832 ----
  	{
  #ifdef DEPRECATED_IBM6000_TARGET
  	  /* If this object is from a shared library, then you should
! 	     stat on the library name, not member name.  */
  
  	  if (objfile->obfd->my_archive)
  	    res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
*************** reread_symbols (void)
*** 1823,1831 ****
  	    res = stat (objfile->name, &new_statbuf);
  	  if (res != 0)
  	    {
! 	      /* FIXME, should use print_sys_errmsg but it's not filtered. */
  	      printf_unfiltered ("`%s' has disappeared; keeping its symbols.\n",
! 			       objfile->name);
  	      continue;
  	    }
  	  new_modtime = new_statbuf.st_mtime;
--- 1835,1843 ----
  	    res = stat (objfile->name, &new_statbuf);
  	  if (res != 0)
  	    {
! 	      /* FIXME, should use print_sys_errmsg but it's not filtered.  */
  	      printf_unfiltered ("`%s' has disappeared; keeping its symbols.\n",
! 				 objfile->name);
  	      continue;
  	    }
  	  new_modtime = new_statbuf.st_mtime;
*************** reread_symbols (void)
*** 1837,1850 ****
  	      char *obfd_filename;
  
  	      printf_unfiltered ("`%s' has changed; re-reading symbols.\n",
! 			       objfile->name);
  
  	      /* There are various functions like symbol_file_add,
  	         symfile_bfd_open, syms_from_objfile, etc., which might
  	         appear to do what we want.  But they have various other
  	         effects which we *don't* want.  So we just do stuff
! 	         ourselves.  We don't worry about mapped files (for one thing,
! 	         any mapped file will be out of date).  */
  
  	      /* If we get an error, blow away this objfile (not sure if
  	         that is the correct response for things like shared
--- 1849,1862 ----
  	      char *obfd_filename;
  
  	      printf_unfiltered ("`%s' has changed; re-reading symbols.\n",
! 				 objfile->name);
  
  	      /* There are various functions like symbol_file_add,
  	         symfile_bfd_open, syms_from_objfile, etc., which might
  	         appear to do what we want.  But they have various other
  	         effects which we *don't* want.  So we just do stuff
! 	         ourselves.  We don't worry about mapped files (for one
! 	         thing, any mapped file will be out of date).  */
  
  	      /* If we get an error, blow away this objfile (not sure if
  	         that is the correct response for things like shared
*************** reread_symbols (void)
*** 1853,1861 ****
  	      /* We need to do this whenever any symbols go away.  */
  	      make_cleanup (clear_symtab_users_cleanup, 0 /*ignore*/);
  
! 	      /* Clean up any state BFD has sitting around.  We don't need
! 	         to close the descriptor but BFD lacks a way of closing the
! 	         BFD without closing the descriptor.  */
  	      obfd_filename = bfd_get_filename (objfile->obfd);
  	      if (!bfd_close (objfile->obfd))
  		error ("Can't close BFD for %s: %s", objfile->name,
--- 1865,1873 ----
  	      /* We need to do this whenever any symbols go away.  */
  	      make_cleanup (clear_symtab_users_cleanup, 0 /*ignore*/);
  
! 	      /* Clean up any state BFD has sitting around.  We don't
! 	         need to close the descriptor but BFD lacks a way of
! 	         closing the BFD without closing the descriptor.  */
  	      obfd_filename = bfd_get_filename (objfile->obfd);
  	      if (!bfd_close (objfile->obfd))
  		error ("Can't close BFD for %s: %s", objfile->name,
*************** reread_symbols (void)
*** 1868,1887 ****
  		error ("Can't read symbols from %s: %s.", objfile->name,
  		       bfd_errmsg (bfd_get_error ()));
  
! 	      /* Save the offsets, we will nuke them with the rest of the
! 	         objfile_obstack.  */
  	      num_offsets = objfile->num_sections;
  	      offsets = ((struct section_offsets *)
  			 alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets)));
  	      memcpy (offsets, objfile->section_offsets,
  		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
  
! 	      /* Nuke all the state that we will re-read.  Much of the following
! 	         code which sets things to NULL really is necessary to tell
! 	         other parts of GDB that there is nothing currently there.  */
  
! 	      /* FIXME: Do we have to free a whole linked list, or is this
! 	         enough?  */
  	      if (objfile->global_psymbols.list)
  		xfree (objfile->global_psymbols.list);
  	      memset (&objfile->global_psymbols, 0,
--- 1880,1900 ----
  		error ("Can't read symbols from %s: %s.", objfile->name,
  		       bfd_errmsg (bfd_get_error ()));
  
! 	      /* Save the offsets, we will nuke them with the rest of
! 	         the objfile_obstack.  */
  	      num_offsets = objfile->num_sections;
  	      offsets = ((struct section_offsets *)
  			 alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets)));
  	      memcpy (offsets, objfile->section_offsets,
  		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
  
! 	      /* Nuke all the state that we will re-read.  Much of the
! 	         following code which sets things to NULL really is
! 	         necessary to tell other parts of GDB that there is
! 	         nothing currently there.  */
  
! 	      /* FIXME: Do we have to free a whole linked list, or is
! 	         this enough?  */
  	      if (objfile->global_psymbols.list)
  		xfree (objfile->global_psymbols.list);
  	      memset (&objfile->global_psymbols, 0,
*************** reread_symbols (void)
*** 1937,1944 ****
  		}
                terminate_minimal_symbol_table (objfile);
  
! 	      /* We use the same section offsets as from last time.  I'm not
! 	         sure whether that is always correct for shared libraries.  */
  	      objfile->section_offsets = (struct section_offsets *)
  		obstack_alloc (&objfile->objfile_obstack,
  			       SIZEOF_N_SECTION_OFFSETS (num_offsets));
--- 1950,1958 ----
  		}
                terminate_minimal_symbol_table (objfile);
  
! 	      /* We use the same section offsets as from last time.
! 	         I'm not sure whether that is always correct for
! 	         shared libraries.  */
  	      objfile->section_offsets = (struct section_offsets *)
  		obstack_alloc (&objfile->objfile_obstack,
  			       SIZEOF_N_SECTION_OFFSETS (num_offsets));
*************** reread_symbols (void)
*** 1946,1954 ****
  		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
  	      objfile->num_sections = num_offsets;
  
! 	      /* What the hell is sym_new_init for, anyway?  The concept of
! 	         distinguishing between the main file and additional files
! 	         in this way seems rather dubious.  */
  	      if (objfile == symfile_objfile)
  		{
  		  (*objfile->sf->sym_new_init) (objfile);
--- 1960,1969 ----
  		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
  	      objfile->num_sections = num_offsets;
  
! 	      /* What the hell is sym_new_init for, anyway?  The
! 	         concept of distinguishing between the main file and
! 	         additional files in this way seems rather
! 	         dubious.  */
  	      if (objfile == symfile_objfile)
  		{
  		  (*objfile->sf->sym_new_init) (objfile);
*************** reread_symbols (void)
*** 1956,1964 ****
  
  	      (*objfile->sf->sym_init) (objfile);
  	      clear_complaints (&symfile_complaints, 1, 1);
! 	      /* The "mainline" parameter is a hideous hack; I think leaving it
! 	         zero is OK since dbxread.c also does what it needs to do if
! 	         objfile->global_psymbols.size is 0.  */
  	      (*objfile->sf->sym_read) (objfile, 0);
  	      if (!have_partial_symbols () && !have_full_symbols ())
  		{
--- 1971,1980 ----
  
  	      (*objfile->sf->sym_init) (objfile);
  	      clear_complaints (&symfile_complaints, 1, 1);
! 	      /* The "mainline" parameter is a hideous hack; I think
! 	         leaving it zero is OK since dbxread.c also does what
! 	         it needs to do if objfile->global_psymbols.size is 0.
! 	      */
  	      (*objfile->sf->sym_read) (objfile, 0);
  	      if (!have_partial_symbols () && !have_full_symbols ())
  		{
*************** reread_symbols (void)
*** 1968,1987 ****
  		}
  	      objfile->flags |= OBJF_SYMS;
  
! 	      /* We're done reading the symbol file; finish off complaints.  */
  	      clear_complaints (&symfile_complaints, 0, 1);
  
! 	      /* Getting new symbols may change our opinion about what is
! 	         frameless.  */
  
  	      reinit_frame_cache ();
  
  	      /* Discard cleanups as symbol reading was successful.  */
  	      discard_cleanups (old_cleanups);
  
! 	      /* If the mtime has changed between the time we set new_modtime
! 	         and now, we *want* this to be out of date, so don't call stat
! 	         again now.  */
  	      objfile->mtime = new_modtime;
  	      reread_one = 1;
                reread_separate_symbols (objfile);
--- 1984,2004 ----
  		}
  	      objfile->flags |= OBJF_SYMS;
  
! 	      /* We're done reading the symbol file; finish off
! 		 complaints.  */
  	      clear_complaints (&symfile_complaints, 0, 1);
  
! 	      /* Getting new symbols may change our opinion about what
! 	         is frameless.  */
  
  	      reinit_frame_cache ();
  
  	      /* Discard cleanups as symbol reading was successful.  */
  	      discard_cleanups (old_cleanups);
  
! 	      /* If the mtime has changed between the time we set
! 	         new_modtime and now, we *want* this to be out of
! 	         date, so don't call stat again now.  */
  	      objfile->mtime = new_modtime;
  	      reread_one = 1;
                reread_separate_symbols (objfile);
*************** reread_separate_symbols (struct objfile 
*** 2032,2038 ****
           visited it in this function's outermost
           loop.  */
        if (! debug_file
!           || strcmp (debug_file, objfile->separate_debug_objfile->name) != 0)
          free_objfile (objfile->separate_debug_objfile);
      }
  
--- 2049,2056 ----
           visited it in this function's outermost
           loop.  */
        if (! debug_file
!           || strcmp (debug_file, 
! 		     objfile->separate_debug_objfile->name) != 0)
          free_objfile (objfile->separate_debug_objfile);
      }
  
*************** reread_separate_symbols (struct objfile 
*** 2046,2057 ****
        objfile->separate_debug_objfile
          = (symbol_file_add_with_addrs_or_offsets
             (symfile_bfd_open (debug_file),
!             info_verbose, /* from_tty: Don't override the default. */
              0, /* No addr table.  */
              objfile->section_offsets, objfile->num_sections,
              0, /* Not mainline.  See comments about this above.  */
!             objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW
!                               | OBJF_USERLOADED)));
        objfile->separate_debug_objfile->separate_debug_objfile_backlink
          = objfile;
      }
--- 2064,2075 ----
        objfile->separate_debug_objfile
          = (symbol_file_add_with_addrs_or_offsets
             (symfile_bfd_open (debug_file),
!             info_verbose, /* from_tty: Don't override the default.  */
              0, /* No addr table.  */
              objfile->section_offsets, objfile->num_sections,
              0, /* Not mainline.  See comments about this above.  */
!             objfile->flags & (OBJF_REORDERED | OBJF_SHARED
!                               | OBJF_READNOW | OBJF_USERLOADED)));
        objfile->separate_debug_objfile->separate_debug_objfile_backlink
          = objfile;
      }
*************** set_ext_lang_command (char *args, int fr
*** 2129,2145 ****
  
    if (i >= fl_table_next)
      {
!       /* new file extension */
        add_filename_language (ext_args, lang);
      }
    else
      {
!       /* redefining a previously known filename extension */
! 
!       /* if (from_tty) */
!       /*   query ("Really make files of type %s '%s'?", */
!       /*          ext_args, language_str (lang));           */
! 
        xfree (filename_language_table[i].ext);
        filename_language_table[i].ext = xstrdup (ext_args);
        filename_language_table[i].lang = lang;
--- 2147,2163 ----
  
    if (i >= fl_table_next)
      {
!       /* New file extension.  */
        add_filename_language (ext_args, lang);
      }
    else
      {
!       /* Redefining a previously known filename extension.  */
! #if 0
!       if (from_tty) 
! 	query ("Really make files of type %s '%s'?", 
! 	       ext_args, language_str (lang));
! #endif
        xfree (filename_language_table[i].ext);
        filename_language_table[i].ext = xstrdup (ext_args);
        filename_language_table[i].lang = lang;
*************** info_ext_lang_command (char *args, int f
*** 2162,2168 ****
  static void
  init_filename_language_table (void)
  {
!   if (fl_table_size == 0)	/* protect against repetition */
      {
        fl_table_size = 20;
        fl_table_next = 0;
--- 2180,2186 ----
  static void
  init_filename_language_table (void)
  {
!   if (fl_table_size == 0)	/* Protect against repetition.  */
      {
        fl_table_size = 20;
        fl_table_next = 0;
*************** deduce_language_from_filename (char *fil
*** 2209,2216 ****
  
  /* allocate_symtab:
  
!    Allocate and partly initialize a new symbol table.  Return a pointer
!    to it.  error() if no space.
  
     Caller must set these fields:
     LINETABLE(symtab)
--- 2227,2234 ----
  
  /* allocate_symtab:
  
!    Allocate and partly initialize a new symbol table.  Return a
!    pointer to it.  error() if no space.
  
     Caller must set these fields:
     LINETABLE(symtab)
*************** allocate_symtab (char *filename, struct 
*** 2236,2242 ****
    symtab->debugformat = obsavestring ("unknown", 7,
  				      &objfile->objfile_obstack);
  
!   /* Hook it to the objfile it comes from */
  
    symtab->objfile = objfile;
    symtab->next = objfile->symtabs;
--- 2254,2260 ----
    symtab->debugformat = obsavestring ("unknown", 7,
  				      &objfile->objfile_obstack);
  
!   /* Hook it to the objfile it comes from.  */
  
    symtab->objfile = objfile;
    symtab->next = objfile->symtabs;
*************** allocate_psymtab (char *filename, struct
*** 2275,2281 ****
  
    /* Prepend it to the psymtab list for the objfile it belongs to.
       Psymtabs are searched in most recent inserted -> least recent
!      inserted order. */
  
    psymtab->objfile = objfile;
    psymtab->next = objfile->psymtabs;
--- 2293,2299 ----
  
    /* Prepend it to the psymtab list for the objfile it belongs to.
       Psymtabs are searched in most recent inserted -> least recent
!      inserted order.  */
  
    psymtab->objfile = objfile;
    psymtab->next = objfile->psymtabs;
*************** cashier_psymtab (struct partial_symtab *
*** 2421,2427 ****
           the psymtabs are reclaimed.  Ditto the dependencies list and
           filename, which are all in the objfile_obstack.  */
  
!       /* We need to cashier any psymtab that has this one as a dependency... */
      again:
        for (ps = pst->objfile->psymtabs; ps; ps = ps->next)
  	{
--- 2439,2446 ----
           the psymtabs are reclaimed.  Ditto the dependencies list and
           filename, which are all in the objfile_obstack.  */
  
!       /* We need to cashier any psymtab that has this one as a
! 	 dependency...  */
      again:
        for (ps = pst->objfile->psymtabs; ps; ps = ps->next)
  	{
*************** cashier_psymtab (struct partial_symtab *
*** 2430,2436 ****
  	      if (ps->dependencies[i] == pst)
  		{
  		  cashier_psymtab (ps);
! 		  goto again;	/* Must restart, chain has been munged. */
  		}
  	    }
  	}
--- 2449,2455 ----
  	      if (ps->dependencies[i] == pst)
  		{
  		  cashier_psymtab (ps);
! 		  goto again;	/* Must restart, chain has been munged.  */
  		}
  	    }
  	}
*************** free_named_symtabs (char *name)
*** 2461,2467 ****
       file?  -- fnf
       Well, the answer is that some systems permit reloading of particular
       compilation units.  We want to blow away any old info about these
!      compilation units, regardless of which objfiles they arrived in. --gnu.  */
  
    struct symtab *s;
    struct symtab *prev;
--- 2480,2487 ----
       file?  -- fnf
       Well, the answer is that some systems permit reloading of particular
       compilation units.  We want to blow away any old info about these
!      compilation units, regardless of which objfiles they arrived in. 
!      --gnu.  */
  
    struct symtab *s;
    struct symtab *prev;
*************** free_named_symtabs (char *name)
*** 2473,2479 ****
    if (!symbol_reloading)
      return 0;
  
!   /* Some symbol formats have trouble providing file names... */
    if (name == 0 || *name == '\0')
      return 0;
  
--- 2493,2499 ----
    if (!symbol_reloading)
      return 0;
  
!   /* Some symbol formats have trouble providing file names...  */
    if (name == 0 || *name == '\0')
      return 0;
  
*************** again2:
*** 2484,2491 ****
      {
        if (strcmp (name, ps->filename) == 0)
  	{
! 	  cashier_psymtab (ps);	/* Blow it away...and its little dog, too.  */
! 	  goto again2;		/* Must restart, chain has been munged */
  	}
      }
  
--- 2504,2512 ----
      {
        if (strcmp (name, ps->filename) == 0)
  	{
! 	  cashier_psymtab (ps);	/* Blow it away...
! 				   and its little dog, too.  */
! 	  goto again2;		/* Must restart, chain has been munged.  */
  	}
      }
  
*************** again2:
*** 2505,2513 ****
        else
  	prev->next = s->next;
  
!       /* For now, queue a delete for all breakpoints, displays, etc., whether
!          or not they depend on the symtab being freed.  This should be
!          changed so that only those data structures affected are deleted.  */
  
        /* But don't delete anything if the symtab is empty.
           This test is necessary due to a bug in "dbxread.c" that
--- 2526,2535 ----
        else
  	prev->next = s->next;
  
!       /* For now, queue a delete for all breakpoints, displays, etc.,
!          whether or not they depend on the symtab being freed.  This
!          should be changed so that only those data structures affected
!          are deleted.  */
  
        /* But don't delete anything if the symtab is empty.
           This test is necessary due to a bug in "dbxread.c" that
*************** again2:
*** 2520,2535 ****
  	  || BLOCK_NSYMS (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK))
  	  || BLOCK_NSYMS (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)))
  	{
! 	  complaint (&symfile_complaints, "Replacing old symbols for `%s'",
! 		     name);
  	  clear_symtab_users_queued++;
  	  make_cleanup (clear_symtab_users_once, 0);
  	  blewit = 1;
  	}
        else
  	{
! 	  complaint (&symfile_complaints, "Empty symbol table found for `%s'",
! 		     name);
  	}
  
        free_symtab (s);
--- 2542,2557 ----
  	  || BLOCK_NSYMS (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK))
  	  || BLOCK_NSYMS (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)))
  	{
! 	  complaint (&symfile_complaints,
! 		     "Replacing old symbols for `%s'", name);
  	  clear_symtab_users_queued++;
  	  make_cleanup (clear_symtab_users_once, 0);
  	  blewit = 1;
  	}
        else
  	{
! 	  complaint (&symfile_complaints, 
! 		     "Empty symbol table found for `%s'", name);
  	}
  
        free_symtab (s);
*************** again2:
*** 2539,2547 ****
        /* It is still possible that some breakpoints will be affected
           even though no symtab was found, since the file might have
           been compiled without debugging, and hence not be associated
!          with a symtab.  In order to handle this correctly, we would need
!          to keep a list of text address ranges for undebuggable files.
!          For now, we do nothing, since this is a fairly obscure case.  */
        ;
      }
  
--- 2561,2570 ----
        /* It is still possible that some breakpoints will be affected
           even though no symtab was found, since the file might have
           been compiled without debugging, and hence not be associated
!          with a symtab.  In order to handle this correctly, we would
!          need to keep a list of text address ranges for undebuggable
!          files.  For now, we do nothing, since this is a fairly
!          obscure case.  */
        ;
      }
  
*************** again2:
*** 2555,2566 ****
  /* Allocate and partially fill a partial symtab.  It will be
     completely filled at the end of the symbol list.
  
!    FILENAME is the name of the symbol-file we are reading from. */
  
  struct partial_symtab *
  start_psymtab_common (struct objfile *objfile,
! 		      struct section_offsets *section_offsets, char *filename,
! 		      CORE_ADDR textlow, struct partial_symbol **global_syms,
  		      struct partial_symbol **static_syms)
  {
    struct partial_symtab *psymtab;
--- 2578,2590 ----
  /* Allocate and partially fill a partial symtab.  It will be
     completely filled at the end of the symbol list.
  
!    FILENAME is the name of the symbol-file we are reading from.  */
  
  struct partial_symtab *
  start_psymtab_common (struct objfile *objfile,
! 		      struct section_offsets *section_offsets, 
! 		      char *filename, CORE_ADDR textlow, 
! 		      struct partial_symbol **global_syms,
  		      struct partial_symbol **static_syms)
  {
    struct partial_symtab *psymtab;
*************** start_psymtab_common (struct objfile *ob
*** 2590,2598 ****
     cache.  */
  
  const struct partial_symbol *
! add_psymbol_to_list (char *name, int namelength, domain_enum domain,
  		     enum address_class class,
! 		     struct psymbol_allocation_list *list, long val,	/* Value as a long */
  		     CORE_ADDR coreaddr,	/* Value as a CORE_ADDR */
  		     enum language language, struct objfile *objfile)
  {
--- 2614,2624 ----
     cache.  */
  
  const struct partial_symbol *
! add_psymbol_to_list (char *name, int namelength, 
! 		     domain_enum domain,
  		     enum address_class class,
! 		     struct psymbol_allocation_list *list, 
! 		     long val,			/* Value as a long */
  		     CORE_ADDR coreaddr,	/* Value as a CORE_ADDR */
  		     enum language language, struct objfile *objfile)
  {
*************** add_psymbol_to_list (char *name, int nam
*** 2600,2612 ****
    char *buf = alloca (namelength + 1);
    /* psymbol is static so that there will be no uninitialized gaps in the
       structure which might contain random data, causing cache misses in
!      bcache. */
    static struct partial_symbol psymbol;
  
    /* Create local copy of the partial symbol */
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   /* val and coreaddr are mutually exclusive, one of them *will* be zero */
    if (val != 0)
      {
        SYMBOL_VALUE (&psymbol) = val;
--- 2626,2638 ----
    char *buf = alloca (namelength + 1);
    /* psymbol is static so that there will be no uninitialized gaps in the
       structure which might contain random data, causing cache misses in
!      bcache.  */
    static struct partial_symbol psymbol;
  
    /* Create local copy of the partial symbol */
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   /* val and coreaddr are mutually exclusive, one of them *will* be zero.  */
    if (val != 0)
      {
        SYMBOL_VALUE (&psymbol) = val;
*************** add_psymbol_to_list (char *name, int nam
*** 2626,2632 ****
    psym = deprecated_bcache (&psymbol, sizeof (struct partial_symbol),
  			    objfile->psymbol_cache);
  
!   /* Save pointer to partial symbol in psymtab, growing symtab if needed. */
    if (list->next >= list->list + list->size)
      {
        extend_psymbol_list (list, objfile);
--- 2652,2658 ----
    psym = deprecated_bcache (&psymbol, sizeof (struct partial_symbol),
  			    objfile->psymbol_cache);
  
!   /* Save pointer to partial symbol in psymtab, growing symtab if needed.  */
    if (list->next >= list->list + list->size)
      {
        extend_psymbol_list (list, objfile);
*************** add_psymbol_to_list (char *name, int nam
*** 2639,2668 ****
  
  /* Add a symbol with a long value to a psymtab. This differs from
   * add_psymbol_to_list above in taking both a mangled and a demangled
!  * name. */
  
  void
! add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
! 				   int dem_namelength, domain_enum domain,
  				   enum address_class class,
! 				   struct psymbol_allocation_list *list, long val,	/* Value as a long */
! 				   CORE_ADDR coreaddr,	/* Value as a CORE_ADDR */
  				   enum language language,
  				   struct objfile *objfile)
  {
    struct partial_symbol *psym;
    char *buf = alloca (namelength + 1);
!   /* psymbol is static so that there will be no uninitialized gaps in the
!      structure which might contain random data, causing cache misses in
!      bcache. */
    static struct partial_symbol psymbol;
  
    /* Create local copy of the partial symbol */
  
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   DEPRECATED_SYMBOL_NAME (&psymbol) = deprecated_bcache (buf, namelength + 1,
! 							 objfile->psymbol_cache);
  
    buf = alloca (dem_namelength + 1);
    memcpy (buf, dem_name, dem_namelength);
--- 2665,2698 ----
  
  /* Add a symbol with a long value to a psymtab. This differs from
   * add_psymbol_to_list above in taking both a mangled and a demangled
!  * name.  */
  
  void
! add_psymbol_with_dem_name_to_list (char *name, int namelength, 
! 				   char *dem_name, int dem_namelength, 
! 				   domain_enum domain,
  				   enum address_class class,
! 				   struct psymbol_allocation_list *list, 
! 				   /* Value as a long */
! 				   long val,
! 				   /* Value as a CORE_ADDR */
! 				   CORE_ADDR coreaddr,
  				   enum language language,
  				   struct objfile *objfile)
  {
    struct partial_symbol *psym;
    char *buf = alloca (namelength + 1);
!   /* psymbol is static so that there will be no uninitialized gaps in
!      the structure which might contain random data, causing cache
!      misses in bcache.  */
    static struct partial_symbol psymbol;
  
    /* Create local copy of the partial symbol */
  
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   DEPRECATED_SYMBOL_NAME (&psymbol) = 
!     deprecated_bcache (buf, namelength + 1, objfile->psymbol_cache);
  
    buf = alloca (dem_namelength + 1);
    memcpy (buf, dem_name, dem_namelength);
*************** add_psymbol_with_dem_name_to_list (char 
*** 2675,2684 ****
        SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) =
  	deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
        break;
!       /* FIXME What should be done for the default case? Ignoring for now. */
      }
  
!   /* val and coreaddr are mutually exclusive, one of them *will* be zero */
    if (val != 0)
      {
        SYMBOL_VALUE (&psymbol) = val;
--- 2705,2715 ----
        SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) =
  	deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
        break;
!       /* FIXME What should be done for the default case? 
! 	 Ignoring for now.  */
      }
  
!   /* val and coreaddr are mutually exclusive, one of them *will* be zero.  */
    if (val != 0)
      {
        SYMBOL_VALUE (&psymbol) = val;
*************** add_psymbol_with_dem_name_to_list (char 
*** 2697,2703 ****
    psym = deprecated_bcache (&psymbol, sizeof (struct partial_symbol),
  			    objfile->psymbol_cache);
  
!   /* Save pointer to partial symbol in psymtab, growing symtab if needed. */
    if (list->next >= list->list + list->size)
      {
        extend_psymbol_list (list, objfile);
--- 2728,2734 ----
    psym = deprecated_bcache (&psymbol, sizeof (struct partial_symbol),
  			    objfile->psymbol_cache);
  
!   /* Save pointer to partial symbol in psymtab, growing symtab if needed.  */
    if (list->next >= list->list + list->size)
      {
        extend_psymbol_list (list, objfile);
*************** init_psymbol_list (struct objfile *objfi
*** 2722,2730 ****
        xfree (objfile->static_psymbols.list);
      }
  
!   /* Current best guess is that approximately a twentieth
!      of the total symbols (in a debugging file) are global or static
!      oriented symbols */
  
    objfile->global_psymbols.size = total_symbols / 10;
    objfile->static_psymbols.size = total_symbols / 10;
--- 2753,2761 ----
        xfree (objfile->static_psymbols.list);
      }
  
!   /* Current best guess is that approximately a twentieth of the total
!      symbols (in a debugging file) are global or static oriented
!      symbols.  */
  
    objfile->global_psymbols.size = total_symbols / 10;
    objfile->static_psymbols.size = total_symbols / 10;
*************** init_psymbol_list (struct objfile *objfi
*** 2746,2752 ****
  }
  
  /* OVERLAYS:
!    The following code implements an abstraction for debugging overlay sections.
  
     The target model is as follows:
     1) The gnu linker will permit multiple sections to be mapped into the
--- 2777,2784 ----
  }
  
  /* OVERLAYS:
!    The following code implements an abstraction for debugging overlay 
!    sections.
  
     The target model is as follows:
     1) The gnu linker will permit multiple sections to be mapped into the
*************** init_psymbol_list (struct objfile *objfi
*** 2797,2803 ****
  /* Overlay debugging state: */
  
  enum overlay_debugging_state overlay_debugging = ovly_off;
! int overlay_cache_invalid = 0;	/* True if need to refresh mapped state */
  
  /* Target vector for refreshing overlay mapped state */
  static void simple_overlay_update (struct obj_section *);
--- 2829,2835 ----
  /* Overlay debugging state: */
  
  enum overlay_debugging_state overlay_debugging = ovly_off;
! int overlay_cache_invalid = 0;	/* True if need to refresh mapped state.  */
  
  /* Target vector for refreshing overlay mapped state */
  static void simple_overlay_update (struct obj_section *);
*************** void (*target_overlay_update) (struct ob
*** 2810,2816 ****
  int
  section_is_overlay (asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    if (overlay_debugging)
      if (section && section->lma != 0 &&
--- 2842,2848 ----
  int
  section_is_overlay (asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_lma methods.  */
  
    if (overlay_debugging)
      if (section && section->lma != 0 &&
*************** overlay_is_mapped (struct obj_section *o
*** 2856,2863 ****
      case ovly_off:
        return 0;			/* overlay debugging off */
      case ovly_auto:		/* overlay debugging automatic */
!       /* Unles there is a target_overlay_update function,
!          there's really nothing useful to do here (can't really go auto)  */
        if (target_overlay_update)
  	{
  	  if (overlay_cache_invalid)
--- 2888,2895 ----
      case ovly_off:
        return 0;			/* overlay debugging off */
      case ovly_auto:		/* overlay debugging automatic */
!       /* Unles there is a target_overlay_update function, there's
!          really nothing useful to do here (can't really go auto).  */
        if (target_overlay_update)
  	{
  	  if (overlay_cache_invalid)
*************** section_is_mapped (asection *section)
*** 2898,2904 ****
  CORE_ADDR
  pc_in_unmapped_range (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    int size;
  
--- 2930,2936 ----
  CORE_ADDR
  pc_in_unmapped_range (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_lma methods.  */
  
    int size;
  
*************** pc_in_unmapped_range (CORE_ADDR pc, asec
*** 2918,2924 ****
  CORE_ADDR
  pc_in_mapped_range (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
  
    int size;
  
--- 2950,2956 ----
  CORE_ADDR
  pc_in_mapped_range (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_vma methods.  */
  
    int size;
  
*************** pc_in_mapped_range (CORE_ADDR pc, asecti
*** 2938,2944 ****
  static int
  sections_overlap (asection *a, asection *b)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
  
    CORE_ADDR a_start = a->vma;
    CORE_ADDR a_end = a->vma + bfd_get_section_size (a);
--- 2970,2976 ----
  static int
  sections_overlap (asection *a, asection *b)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_vma methods.  */
  
    CORE_ADDR a_start = a->vma;
    CORE_ADDR a_end = a->vma + bfd_get_section_size (a);
*************** sections_overlap (asection *a, asection 
*** 2955,2961 ****
  CORE_ADDR
  overlay_unmapped_address (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    if (overlay_debugging)
      if (section && section_is_overlay (section) &&
--- 2987,2993 ----
  CORE_ADDR
  overlay_unmapped_address (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_lma methods.  */
  
    if (overlay_debugging)
      if (section && section_is_overlay (section) &&
*************** overlay_unmapped_address (CORE_ADDR pc, 
*** 2972,2978 ****
  CORE_ADDR
  overlay_mapped_address (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
  
    if (overlay_debugging)
      if (section && section_is_overlay (section) &&
--- 3004,3010 ----
  CORE_ADDR
  overlay_mapped_address (CORE_ADDR pc, asection *section)
  {
!   /* FIXME: need bfd *, so we can use bfd_section_vma methods.  */
  
    if (overlay_debugging)
      if (section && section_is_overlay (section) &&
*************** symbol_overlayed_address (CORE_ADDR addr
*** 2992,3009 ****
  {
    if (overlay_debugging)
      {
!       /* If the symbol has no section, just return its regular address. */
        if (section == 0)
  	return address;
!       /* If the symbol's section is not an overlay, just return its address */
        if (!section_is_overlay (section))
  	return address;
        /* If the symbol's section is mapped, just return its address */
        if (section_is_mapped (section))
  	return address;
        /*
!        * HOWEVER: if the symbol is in an overlay section which is NOT mapped,
!        * then return its LOADED address rather than its vma address!!
         */
        return overlay_unmapped_address (address, section);
      }
--- 3024,3044 ----
  {
    if (overlay_debugging)
      {
!       /* If the symbol has no section, just return its regular
! 	 address.  */
        if (section == 0)
  	return address;
!       /* If the symbol's section is not an overlay, just return its
! 	 address.  */
        if (!section_is_overlay (section))
  	return address;
        /* If the symbol's section is mapped, just return its address */
        if (section_is_mapped (section))
  	return address;
        /*
!        * HOWEVER: if the symbol is in an overlay section which is NOT
!        * mapped, then return its LOADED address rather than its vma
!        * address!!
         */
        return overlay_unmapped_address (address, section);
      }
*************** the 'overlay manual' command.");
*** 3117,3125 ****
  
    /* First, find a section matching the user supplied argument */
    ALL_OBJSECTIONS (objfile, sec)
!     if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
      {
!       /* Now, check to see if the section is an overlay. */
        bfdsec = sec->the_bfd_section;
        if (!section_is_overlay (bfdsec))
  	continue;		/* not an overlay section */
--- 3152,3161 ----
  
    /* First, find a section matching the user supplied argument */
    ALL_OBJSECTIONS (objfile, sec)
!     if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), 
! 		 args))
      {
!       /* Now, check to see if the section is an overlay.  */
        bfdsec = sec->the_bfd_section;
        if (!section_is_overlay (bfdsec))
  	continue;		/* not an overlay section */
*************** the 'overlay manual' command.");
*** 3167,3173 ****
  
    /* First, find a section matching the user supplied argument */
    ALL_OBJSECTIONS (objfile, sec)
!     if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
      {
        if (!sec->ovly_mapped)
  	error ("Section %s is not mapped", args);
--- 3203,3211 ----
  
    /* First, find a section matching the user supplied argument */
    ALL_OBJSECTIONS (objfile, sec)
!     if (!strcmp (bfd_section_name (objfile->obfd, 
! 				   sec->the_bfd_section), 
! 		 args))
      {
        if (!sec->ovly_mapped)
  	error ("Section %s is not mapped", args);
*************** the 'overlay manual' command.");
*** 3179,3185 ****
  
  /* Function: overlay_auto_command
     A utility command to turn on overlay debugging.
!    Possibly this should be done via a set/show command. */
  
  static void
  overlay_auto_command (char *args, int from_tty)
--- 3217,3223 ----
  
  /* Function: overlay_auto_command
     A utility command to turn on overlay debugging.
!    Possibly this should be done via a set/show command.  */
  
  static void
  overlay_auto_command (char *args, int from_tty)
*************** overlay_auto_command (char *args, int fr
*** 3192,3198 ****
  
  /* Function: overlay_manual_command
     A utility command to turn on overlay debugging.
!    Possibly this should be done via a set/show command. */
  
  static void
  overlay_manual_command (char *args, int from_tty)
--- 3230,3236 ----
  
  /* Function: overlay_manual_command
     A utility command to turn on overlay debugging.
!    Possibly this should be done via a set/show command.  */
  
  static void
  overlay_manual_command (char *args, int from_tty)
*************** overlay_manual_command (char *args, int 
*** 3205,3211 ****
  
  /* Function: overlay_off_command
     A utility command to turn on overlay debugging.
!    Possibly this should be done via a set/show command. */
  
  static void
  overlay_off_command (char *args, int from_tty)
--- 3243,3249 ----
  
  /* Function: overlay_off_command
     A utility command to turn on overlay debugging.
!    Possibly this should be done via a set/show command.  */
  
  static void
  overlay_off_command (char *args, int from_tty)
*************** overlay_load_command (char *args, int fr
*** 3228,3234 ****
  /* Function: overlay_command
     A place-holder for a mis-typed command */
  
! /* Command list chain containing all defined "overlay" subcommands. */
  struct cmd_list_element *overlaylist;
  
  static void
--- 3266,3272 ----
  /* Function: overlay_command
     A place-holder for a mis-typed command */
  
! /* Command list chain containing all defined "overlay" subcommands.  */
  struct cmd_list_element *overlaylist;
  
  static void
*************** simple_free_overlay_region_table (void)
*** 3322,3328 ****
  static void
  read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr, int len)
  {
!   /* FIXME (alloca): Not safe if array is very large. */
    char *buf = alloca (len * TARGET_LONG_BYTES);
    int i;
  
--- 3360,3366 ----
  static void
  read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr, int len)
  {
!   /* FIXME (alloca): Not safe if array is very large.  */
    char *buf = alloca (len * TARGET_LONG_BYTES);
    int i;
  
*************** simple_read_overlay_table (void)
*** 3358,3364 ****
        return 0;
      }
  
!   cache_novlys = read_memory_integer (SYMBOL_VALUE_ADDRESS (novlys_msym), 4);
    cache_ovly_table
      = (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
    cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (ovly_table_msym);
--- 3396,3403 ----
        return 0;
      }
  
!   cache_novlys = read_memory_integer (SYMBOL_VALUE_ADDRESS (novlys_msym), 
! 				      4);
    cache_ovly_table
      = (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
    cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (ovly_table_msym);
*************** simple_read_overlay_region_table (void)
*** 3380,3386 ****
    simple_free_overlay_region_table ();
    msym = lookup_minimal_symbol ("_novly_regions", NULL, NULL);
    if (msym != NULL)
!     cache_novly_regions = read_memory_integer (SYMBOL_VALUE_ADDRESS (msym), 4);
    else
      return 0;			/* failure */
    cache_ovly_region_table = (void *) xmalloc (cache_novly_regions * 12);
--- 3419,3426 ----
    simple_free_overlay_region_table ();
    msym = lookup_minimal_symbol ("_novly_regions", NULL, NULL);
    if (msym != NULL)
!     cache_novly_regions = read_memory_integer (SYMBOL_VALUE_ADDRESS (msym), 
! 					       4);
    else
      return 0;			/* failure */
    cache_ovly_region_table = (void *) xmalloc (cache_novly_regions * 12);
*************** simple_overlay_update_1 (struct obj_sect
*** 3433,3439 ****
  	    osect->ovly_mapped = cache_ovly_table[i][MAPPED];
  	    return 1;
  	  }
! 	else	/* Warning!  Warning!  Target's ovly table has changed! */
  	  return 0;
        }
    return 0;
--- 3473,3479 ----
  	    osect->ovly_mapped = cache_ovly_table[i][MAPPED];
  	    return 1;
  	  }
! 	else	/* Warning!  Warning!  Target's ovly table has changed!  */
  	  return 0;
        }
    return 0;
*************** simple_overlay_update (struct obj_sectio
*** 3452,3467 ****
  {
    struct objfile *objfile;
  
!   /* Were we given an osect to look up?  NULL means do all of them. */
    if (osect)
!     /* Have we got a cached copy of the target's overlay table? */
      if (cache_ovly_table != NULL)
!       /* Does its cached location match what's currently in the symtab? */
        if (cache_ovly_table_base ==
! 	  SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table", NULL, NULL)))
! 	/* Then go ahead and try to look up this single section in the cache */
  	if (simple_overlay_update_1 (osect))
! 	  /* Found it!  We're done. */
  	  return;
  
    /* Cached table no good: need to read the entire table anew.
--- 3492,3509 ----
  {
    struct objfile *objfile;
  
!   /* Were we given an osect to look up?  NULL means do all of them.  */
    if (osect)
!     /* Have we got a cached copy of the target's overlay table?  */
      if (cache_ovly_table != NULL)
!       /* Does its cached location match what's currently in the symtab?  */
        if (cache_ovly_table_base ==
! 	  SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table", 
! 						       NULL, NULL)))
! 	/* Then go ahead and try to look up this single section in the
! 	   cache.  */
  	if (simple_overlay_update_1 (osect))
! 	  /* Found it!  We're done.  */
  	  return;
  
    /* Cached table no good: need to read the entire table anew.
*************** simple_overlay_update (struct obj_sectio
*** 3471,3477 ****
    if (! simple_read_overlay_table ())
      return;
  
!   /* Now may as well update all sections, even if only one was requested. */
    ALL_OBJSECTIONS (objfile, osect)
      if (section_is_overlay (osect->the_bfd_section))
      {
--- 3513,3520 ----
    if (! simple_read_overlay_table ())
      return;
  
!   /* Now may as well update all sections, even if only one was
!      requested.  */
    ALL_OBJSECTIONS (objfile, osect)
      if (section_is_overlay (osect->the_bfd_section))
      {
*************** simple_overlay_update (struct obj_sectio
*** 3486,3492 ****
  	    /* && cache_ovly_table[i][SIZE] == size */ )
  	  { /* obj_section matches i'th entry in ovly_table */
  	    osect->ovly_mapped = cache_ovly_table[i][MAPPED];
! 	    break;		/* finished with inner for loop: break out */
  	  }
      }
  }
--- 3529,3535 ----
  	    /* && cache_ovly_table[i][SIZE] == size */ )
  	  { /* obj_section matches i'th entry in ovly_table */
  	    osect->ovly_mapped = cache_ovly_table[i][MAPPED];
! 	    break;	/* Finished with inner for loop: break out.  */
  	  }
      }
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]