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]

[PATCH] Fix up some long lines and indentation in symfile.c


2002-04-12  Michael Snyder  <msnyder@redhat.com>

	* symfile.c: Fix indentation, long lines.

Index: symfile.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/symfile.c,v
retrieving revision 1.255
diff -c -3 -p -r1.255 symfile.c
*** symfile.c	2002/04/05 23:31:56	1.255
--- symfile.c	2002/04/12 20:14:53
***************
*** 59,68 ****
  
  extern int hp_som_som_object_present;
  extern int hp_cxx_exception_support_initialized;
! #define RESET_HP_UX_GLOBALS() do {\
!                                     hp_som_som_object_present = 0;             /* indicates HP-compiled code */        \
!                                     hp_cxx_exception_support_initialized = 0;  /* must reinitialize exception stuff */ \
!                               } while (0)
  #endif
  
  int (*ui_load_progress_hook) (const char *section, unsigned long num);
--- 59,70 ----
  
  extern int hp_som_som_object_present;
  extern int hp_cxx_exception_support_initialized;
! #define RESET_HP_UX_GLOBALS() \
!   do {\
!     hp_som_som_object_present = 0;     /* indicates HP-compiled code */ \
!     hp_cxx_exception_support_initialized = 0; \
!     /* must reinitialize exception stuff */ \
!   } while (0)
  #endif
  
  int (*ui_load_progress_hook) (const char *section, unsigned long num);
*************** syms_from_objfile (struct objfile *objfi
*** 580,587 ****
    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 (mainline)
--- 582,589 ----
    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 (mainline)
*************** syms_from_objfile (struct objfile *objfi
*** 625,631 ****
  	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),
--- 627,634 ----
  	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
*** 650,667 ****
  	{
  	  if (addrs->other[i].addr != 0)
   	    {
!  	      sect = bfd_get_section_by_name (objfile->obfd, addrs->other[i].name);
   	      if (sect)
   		{
!  		  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
  		{
! 		  warning ("section %s not found in %s", addrs->other[i].name, 
! 			   objfile->name);
  		  addrs->other[i].addr = 0;
  		}
   	    }
--- 653,672 ----
  	{
  	  if (addrs->other[i].addr != 0)
   	    {
!  	      sect = bfd_get_section_by_name (objfile->obfd, 
! 					      addrs->other[i].name);
   	      if (sect)
   		{
!  		  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
  		{
! 		  warning ("section %s not found in %s", 
! 			   addrs->other[i].name, objfile->name);
  		  addrs->other[i].addr = 0;
  		}
   	    }
*************** syms_from_objfile (struct objfile *objfi
*** 670,678 ****
  	}
      }
  
!   /* 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 (1, verbo);
--- 675,683 ----
  	}
      }
  
!   /* 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 (1, verbo);
*************** symbol_file_command (char *args, int fro
*** 1025,1037 ****
  
  /* 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)
--- 1030,1042 ----
  
  /* 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)
*************** set_initial_language (void)
*** 1057,1064 ****
  }
  
  /* Open file specified by NAME and hand it off to BFD for preliminary
!    analysis.  Result is a newly initialized bfd *, which includes a newly
!    malloc'd` copy of NAME (tilde-expanded and made absolute).
     In case of trouble, error() is called.  */
  
  bfd *
--- 1062,1069 ----
  }
  
  /* Open file specified by NAME and hand it off to BFD for preliminary
!    analysis.  Result is a newly initialized bfd *, which includes a
!    newly malloc'd` copy of NAME (tilde-expanded and made absolute).
     In case of trouble, error() is called.  */
  
  bfd *
*************** symfile_bfd_open (char *name)
*** 1073,1079 ****
    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"), 1, name, O_RDONLY | O_BINARY, 0, &absolute_name);
  #if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
    if (desc < 0)
      {
--- 1078,1085 ----
    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"), 1, name, O_RDONLY | O_BINARY, 
! 		0, &absolute_name);
  #if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
    if (desc < 0)
      {
*************** generic_load (char *args, int from_tty)
*** 1371,1381 ****
       for other targets too.  */
    write_pc (entry);
  
!   /* FIXME: are we supposed to call symbol_file_add or not?  According to
!      a comment from remote-mips.c (where a call to symbol_file_add was
!      commented out), making the call confuses GDB if more than one file is
!      loaded in.  remote-nindy.c had no call to symbol_file_add, but remote-vx.c
!      does.  */
  
    print_transfer_performance (gdb_stdout, cbdata.data_count, 
  			      cbdata.write_count, end_time - start_time);
--- 1377,1387 ----
       for other targets too.  */
    write_pc (entry);
  
!   /* FIXME: are we supposed to call symbol_file_add or not?  According
!      to a comment from remote-mips.c (where a call to symbol_file_add
!      was commented out), making the call confuses GDB if more than one
!      file is loaded in.  remote-nindy.c had no call to
!      symbol_file_add, but remote-vx.c does.  */
  
    print_transfer_performance (gdb_stdout, cbdata.data_count, 
  			      cbdata.write_count, end_time - start_time);
*************** reread_symbols (void)
*** 1679,1691 ****
  	      /* Save the offsets, we will nuke them with the rest of the
  	         psymbol_obstack.  */
  	      num_offsets = objfile->num_sections;
! 	      offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
! 	      memcpy (offsets, objfile->section_offsets, SIZEOF_SECTION_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)
--- 1685,1700 ----
  	      /* Save the offsets, we will nuke them with the rest of the
  	         psymbol_obstack.  */
  	      num_offsets = objfile->num_sections;
! 	      offsets = (struct section_offsets *) 
! 		alloca (SIZEOF_SECTION_OFFSETS);
! 	      memcpy (offsets, objfile->section_offsets, 
! 		      SIZEOF_SECTION_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)
*************** reread_symbols (void)
*** 1739,1746 ****
  	      /* 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->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
! 	      memcpy (objfile->section_offsets, offsets, SIZEOF_SECTION_OFFSETS);
  	      objfile->num_sections = num_offsets;
  
  	      /* What the hell is sym_new_init for, anyway?  The concept of
--- 1748,1757 ----
  	      /* 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->psymbol_obstack, 
! 			       SIZEOF_SECTION_OFFSETS);
! 	      memcpy (objfile->section_offsets, offsets, 
! 		      SIZEOF_SECTION_OFFSETS);
  	      objfile->num_sections = num_offsets;
  
  	      /* What the hell is sym_new_init for, anyway?  The concept of
*************** reread_symbols (void)
*** 1779,1794 ****
  	      /* 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;
  
! 	      /* Call this after reading in a new symbol table to give target
! 	         dependent code a crack at the new symbols.  For instance, this
! 	         could be used to update the values of target-specific symbols GDB
! 	         needs to keep track of (such as _sigtramp, or whatever).  */
  
  	      TARGET_SYMFILE_POSTREAD (objfile);
  	    }
--- 1790,1806 ----
  	      /* 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;
  
! 	      /* Call this after reading in a new symbol table to give
! 	         target dependent code a crack at the new symbols.
! 	         For instance, this could be used to update the values
! 	         of target-specific symbols GDB needs to keep track of
! 	         (such as _sigtramp, or whatever).  */
  
  	      TARGET_SYMFILE_POSTREAD (objfile);
  	    }
*************** free_named_symtabs (char *name)
*** 2199,2205 ****
       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.  */
  
    register struct symtab *s;
    register struct symtab *prev;
--- 2211,2218 ----
       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.  */
  
    register struct symtab *s;
    register struct symtab *prev;
*************** again2:
*** 2243,2251 ****
        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
--- 2256,2265 ----
        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
*************** start_psymtab_common (struct objfile *ob
*** 2317,2323 ****
  void
  add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
  		     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)
  {
--- 2331,2338 ----
  void
  add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
  		     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
*** 2331,2337 ****
    /* Create local copy of the partial symbol */
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, &objfile->psymbol_cache);
    /* val and coreaddr are mutually exclusive, one of them *will* be zero */
    if (val != 0)
      {
--- 2346,2353 ----
    /* Create local copy of the partial symbol */
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, 
! 				   &objfile->psymbol_cache);
    /* val and coreaddr are mutually exclusive, one of them *will* be zero */
    if (val != 0)
      {
*************** add_psymbol_to_list (char *name, int nam
*** 2348,2354 ****
    SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
  
    /* Stash the partial symbol away in the cache */
!   psym = 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)
--- 2364,2371 ----
    SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
  
    /* Stash the partial symbol away in the cache */
!   psym = 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)
*************** add_psymbol_to_list (char *name, int nam
*** 2364,2374 ****
   * name. */
  
  void
! add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
! 				   int dem_namelength, namespace_enum namespace,
  				   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)
  {
--- 2381,2395 ----
   * name. */
  
  void
! add_psymbol_with_dem_name_to_list (char *name, int namelength, 
! 				   char *dem_name,
! 				   int dem_namelength, 
! 				   namespace_enum namespace,
  				   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_with_dem_name_to_list (char 
*** 2383,2389 ****
  
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, &objfile->psymbol_cache);
  
    buf = alloca (dem_namelength + 1);
    memcpy (buf, dem_name, dem_namelength);
--- 2404,2411 ----
  
    memcpy (buf, name, namelength);
    buf[namelength] = '\0';
!   SYMBOL_NAME (&psymbol) = 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 
*** 2399,2405 ****
      case language_chill:
        SYMBOL_CHILL_DEMANGLED_NAME (&psymbol) =
  	bcache (buf, dem_namelength + 1, &objfile->psymbol_cache);
! 
        /* FIXME What should be done for the default case? Ignoring for now. */
      }
  
--- 2421,2427 ----
      case language_chill:
        SYMBOL_CHILL_DEMANGLED_NAME (&psymbol) =
  	bcache (buf, dem_namelength + 1, &objfile->psymbol_cache);
!       break;
        /* FIXME What should be done for the default case? Ignoring for now. */
      }
  
*************** add_psymbol_with_dem_name_to_list (char 
*** 2419,2425 ****
    SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
  
    /* Stash the partial symbol away in the cache */
!   psym = 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)
--- 2441,2448 ----
    SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
  
    /* Stash the partial symbol away in the cache */
!   psym = 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)
*************** init_psymbol_list (struct objfile *objfi
*** 2470,2476 ****
  }
  
  /* 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
--- 2493,2500 ----
  }
  
  /* 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
*** 2515,2522 ****
     overlay_unmapped_address(...): map an address from section's VMA to LMA
     symbol_overlayed_address(...): Return a "current" address for symbol:
     either in VMA or LMA depending on whether
!    the symbol's section is currently mapped
!  */
  
  /* Overlay debugging state: */
  
--- 2539,2545 ----
     overlay_unmapped_address(...): map an address from section's VMA to LMA
     symbol_overlayed_address(...): Return a "current" address for symbol:
     either in VMA or LMA depending on whether
!    the symbol's section is currently mapped */
  
  /* Overlay debugging state: */
  
*************** section_is_overlay (asection *section)
*** 2537,2544 ****
    /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    if (overlay_debugging)
!     if (section && section->lma != 0 &&
! 	section->vma != section->lma)
        return 1;
  
    return 0;
--- 2560,2567 ----
    /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    if (overlay_debugging)
!     if (section && section->lma != 0 
! 	&& section->vma != section->lma)
        return 1;
  
    return 0;
*************** overlay_invalidate_all (void)
*** 2555,2561 ****
  
    ALL_OBJSECTIONS (objfile, sect)
      if (section_is_overlay (sect->the_bfd_section))
!     sect->ovly_mapped = -1;
  }
  
  /* Function: overlay_is_mapped (SECTION)
--- 2578,2584 ----
  
    ALL_OBJSECTIONS (objfile, sect)
      if (section_is_overlay (sect->the_bfd_section))
!       sect->ovly_mapped = -1;
  }
  
  /* Function: overlay_is_mapped (SECTION)
*************** section_is_mapped (asection *section)
*** 2611,2617 ****
      if (section && section_is_overlay (section))
        ALL_OBJSECTIONS (objfile, osect)
  	if (osect->the_bfd_section == section)
! 	return overlay_is_mapped (osect);
  
    return 0;
  }
--- 2634,2640 ----
      if (section && section_is_overlay (section))
        ALL_OBJSECTIONS (objfile, osect)
  	if (osect->the_bfd_section == section)
! 	  return overlay_is_mapped (osect);
  
    return 0;
  }
*************** overlay_unmapped_address (CORE_ADDR pc, 
*** 2682,2689 ****
    /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    if (overlay_debugging)
!     if (section && section_is_overlay (section) &&
! 	pc_in_mapped_range (pc, section))
        return pc + section->lma - section->vma;
  
    return pc;
--- 2705,2712 ----
    /* FIXME: need bfd *, so we can use bfd_section_lma methods. */
  
    if (overlay_debugging)
!     if (section && section_is_overlay (section) 
! 	&& pc_in_mapped_range (pc, section))
        return pc + section->lma - section->vma;
  
    return pc;
*************** overlay_mapped_address (CORE_ADDR pc, as
*** 2699,2706 ****
    /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
  
    if (overlay_debugging)
!     if (section && section_is_overlay (section) &&
! 	pc_in_unmapped_range (pc, section))
        return pc + section->vma - section->lma;
  
    return pc;
--- 2722,2729 ----
    /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
  
    if (overlay_debugging)
!     if (section && section_is_overlay (section) 
! 	&& pc_in_unmapped_range (pc, section))
        return pc + section->vma - section->lma;
  
    return pc;
*************** find_pc_overlay (CORE_ADDR pc)
*** 2749,2765 ****
    if (overlay_debugging)
      ALL_OBJSECTIONS (objfile, osect)
        if (section_is_overlay (osect->the_bfd_section))
!       {
! 	if (pc_in_mapped_range (pc, osect->the_bfd_section))
! 	  {
! 	    if (overlay_is_mapped (osect))
! 	      return osect->the_bfd_section;
! 	    else
! 	      best_match = osect;
! 	  }
! 	else if (pc_in_unmapped_range (pc, osect->the_bfd_section))
! 	  best_match = osect;
!       }
    return best_match ? best_match->the_bfd_section : NULL;
  }
  
--- 2772,2788 ----
    if (overlay_debugging)
      ALL_OBJSECTIONS (objfile, osect)
        if (section_is_overlay (osect->the_bfd_section))
! 	{
! 	  if (pc_in_mapped_range (pc, osect->the_bfd_section))
! 	    {
! 	      if (overlay_is_mapped (osect))
! 		return osect->the_bfd_section;
! 	      else
! 		best_match = osect;
! 	    }
! 	  else if (pc_in_unmapped_range (pc, osect->the_bfd_section))
! 	    best_match = osect;
! 	}
    return best_match ? best_match->the_bfd_section : NULL;
  }
  
*************** find_pc_mapped_section (CORE_ADDR pc)
*** 2775,2783 ****
  
    if (overlay_debugging)
      ALL_OBJSECTIONS (objfile, osect)
!       if (pc_in_mapped_range (pc, osect->the_bfd_section) &&
! 	  overlay_is_mapped (osect))
!       return osect->the_bfd_section;
  
    return NULL;
  }
--- 2798,2806 ----
  
    if (overlay_debugging)
      ALL_OBJSECTIONS (objfile, osect)
!       if (pc_in_mapped_range (pc, osect->the_bfd_section) 
! 	  && overlay_is_mapped (osect))
! 	return osect->the_bfd_section;
  
    return NULL;
  }
*************** list_overlays_command (char *args, int f
*** 2795,2822 ****
    if (overlay_debugging)
      ALL_OBJSECTIONS (objfile, osect)
        if (overlay_is_mapped (osect))
!       {
! 	const char *name;
! 	bfd_vma lma, vma;
! 	int size;
! 
! 	vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
! 	lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
! 	size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
! 	name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
! 
! 	printf_filtered ("Section %s, loaded at ", name);
! 	print_address_numeric (lma, 1, gdb_stdout);
! 	puts_filtered (" - ");
! 	print_address_numeric (lma + size, 1, gdb_stdout);
! 	printf_filtered (", mapped at ");
! 	print_address_numeric (vma, 1, gdb_stdout);
! 	puts_filtered (" - ");
! 	print_address_numeric (vma + size, 1, gdb_stdout);
! 	puts_filtered ("\n");
  
! 	nmapped++;
!       }
    if (nmapped == 0)
      printf_filtered ("No sections are mapped.\n");
  }
--- 2818,2845 ----
    if (overlay_debugging)
      ALL_OBJSECTIONS (objfile, osect)
        if (overlay_is_mapped (osect))
! 	{
! 	  const char *name;
! 	  bfd_vma lma, vma;
! 	  int size;
! 
! 	  vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
! 	  lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
! 	  size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
! 	  name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
! 
! 	  printf_filtered ("Section %s, loaded at ", name);
! 	  print_address_numeric (lma, 1, gdb_stdout);
! 	  puts_filtered (" - ");
! 	  print_address_numeric (lma + size, 1, gdb_stdout);
! 	  printf_filtered (", mapped at ");
! 	  print_address_numeric (vma, 1, gdb_stdout);
! 	  puts_filtered (" - ");
! 	  print_address_numeric (vma + size, 1, gdb_stdout);
! 	  puts_filtered ("\n");
  
! 	  nmapped++;
! 	}
    if (nmapped == 0)
      printf_filtered ("No sections are mapped.\n");
  }
*************** the 'overlay manual' command.");
*** 2841,2873 ****
  
    /* 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 */
! 
!       /* Mark the overlay as "mapped" */
!       sec->ovly_mapped = 1;
! 
!       /* Next, make a pass and unmap any sections that are
!          overlapped by this new section: */
!       ALL_OBJSECTIONS (objfile2, sec2)
! 	if (sec2->ovly_mapped
!             && sec != sec2
!             && sec->the_bfd_section != sec2->the_bfd_section
!             && sections_overlap (sec->the_bfd_section,
!                                  sec2->the_bfd_section))
! 	{
! 	  if (info_verbose)
! 	    printf_filtered ("Note: section %s unmapped by overlap\n",
! 			     bfd_section_name (objfile->obfd,
! 					       sec2->the_bfd_section));
! 	  sec2->ovly_mapped = 0;	/* sec2 overlaps sec: unmap sec2 */
! 	}
!       return;
!     }
    error ("No overlay section called %s", args);
  }
  
--- 2864,2897 ----
  
    /* 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 */
! 
! 	/* Mark the overlay as "mapped" */
! 	sec->ovly_mapped = 1;
! 
! 	/* Next, make a pass and unmap any sections that are
! 	   overlapped by this new section: */
! 	ALL_OBJSECTIONS (objfile2, sec2)
! 	  if (sec2->ovly_mapped
! 	      && sec != sec2
! 	      && sec->the_bfd_section != sec2->the_bfd_section
! 	      && sections_overlap (sec->the_bfd_section,
! 				   sec2->the_bfd_section))
! 	    {
! 	      if (info_verbose)
! 		printf_filtered ("Note: section %s unmapped by overlap\n",
! 				 bfd_section_name (objfile->obfd,
! 						   sec2->the_bfd_section));
! 	      sec2->ovly_mapped = 0;	/* sec2 overlaps sec: unmap sec2 */
! 	    }
! 	return;
!       }
    error ("No overlay section called %s", args);
  }
  
*************** the 'overlay manual' command.");
*** 2891,2903 ****
  
    /* 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);
!       sec->ovly_mapped = 0;
!       return;
!     }
    error ("No overlay section called %s", args);
  }
  
--- 2915,2928 ----
  
    /* 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);
! 	sec->ovly_mapped = 0;
! 	return;
!       }
    error ("No overlay section called %s", args);
  }
  
*************** simple_overlay_update (struct obj_sectio
*** 3182,3189 ****
      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;
--- 3207,3216 ----
      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;
*************** simple_overlay_update (struct obj_sectio
*** 3198,3218 ****
    /* 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))
!     {
!       int i, size;
!       bfd *obfd = osect->objfile->obfd;
!       asection *bsect = osect->the_bfd_section;
  
!       size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
!       for (i = 0; i < cache_novlys; i++)
! 	if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
! 	    && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
! 	    /* && 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 */
! 	  }
!     }
  }
  
  
--- 3225,3245 ----
    /* 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))
!       {
! 	int i, size;
! 	bfd *obfd = osect->objfile->obfd;
! 	asection *bsect = osect->the_bfd_section;
  
! 	size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
! 	for (i = 0; i < cache_novlys; i++)
! 	  if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
! 	      && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
! 	      /* && 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 */
! 	    }
!       }
  }
  
  
*************** The `file' command can also load symbol 
*** 3227,3234 ****
  to execute.", &cmdlist);
    set_cmd_completer (c, filename_completer);
  
!   c = add_cmd ("add-symbol-file", class_files, add_symbol_file_command,
! 	       "Usage: add-symbol-file FILE ADDR [-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> ...]\n\
  Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
  ADDR is the starting address of the file's text.\n\
  The optional arguments are section-name section-address pairs and\n\
--- 3254,3261 ----
  to execute.", &cmdlist);
    set_cmd_completer (c, filename_completer);
  
!   c = add_cmd ("add-symbol-file", class_files, add_symbol_file_command, "\
! Usage: add-symbol-file FILE ADDR [-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> ...]\n\
  Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
  ADDR is the starting address of the file's text.\n\
  The optional arguments are section-name section-address pairs and\n\
*************** with the text.  SECT is a section name t
*** 3244,3251 ****
    c = add_alias_cmd ("assf", "add-shared-symbol-files", class_files, 1,
  		     &cmdlist);
  
!   c = add_cmd ("load", class_files, load_command,
! 	       "Dynamically load FILE into the running program, and record its symbols\n\
  for access from GDB.", &cmdlist);
    set_cmd_completer (c, filename_completer);
  
--- 3271,3278 ----
    c = add_alias_cmd ("assf", "add-shared-symbol-files", class_files, 1,
  		     &cmdlist);
  
!   c = add_cmd ("load", class_files, load_command, "\
! Dynamically load FILE into the running program, and record its symbols\n\
  for access from GDB.", &cmdlist);
    set_cmd_completer (c, filename_completer);
  
*************** for access from GDB.", &cmdlist);
*** 3284,3291 ****
    /* Filename extension to source language lookup table: */
    init_filename_language_table ();
    c = add_set_cmd ("extension-language", class_files, var_string_noescape,
! 		   (char *) &ext_args,
! 		   "Set mapping between filename extension and source language.\n\
  Usage: set extension-language .foo bar",
  		   &setlist);
    set_cmd_cfunc (c, set_ext_lang_command);
--- 3311,3318 ----
    /* Filename extension to source language lookup table: */
    init_filename_language_table ();
    c = add_set_cmd ("extension-language", class_files, var_string_noescape,
! 		   (char *) &ext_args, "\
! Set mapping between filename extension and source language.\n\
  Usage: set extension-language .foo bar",
  		   &setlist);
    set_cmd_cfunc (c, set_ext_lang_command);


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