This is the mail archive of the gdb-patches@sourceware.org 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]

[comitted/darwin]: house cleaning and renaming


Hi,

I am committing this patch.  It consists in some house cleaning and renaming in machoread.c to improve
readability.

Tristan.

2010-02-04  Tristan Gingold  <gingold@adacore.com>

	* machoread.c (macho_add_oso): Renamed to macho_register_oso.
	(macho_symtab_read): Adjust calls to macho_add_oso.
	(macho_oso_symfile): Renamed to macho_symfile_read_all_oso.
	(macho_symfile_read): Adjust call to macho_oso_symfile.
	(macho_new_init): Move this function after declarations.
	(macho_symfile_init): Ditto.
	* darwin-nat-info.c (darwin_lib_gdb_ports): Remove.
	* darwin-nat.c (darwin_lookup_task): Remove unused prototype.

Index: darwin-nat-info.c
===================================================================
RCS file: /cvs/src/src/gdb/darwin-nat-info.c,v
retrieving revision 1.10
diff -c -r1.10 darwin-nat-info.c
*** darwin-nat-info.c	1 Jan 2010 07:31:30 -0000	1.10
--- darwin-nat-info.c	4 Feb 2010 12:38:20 -0000
***************
*** 843,874 ****
      }
  }
  
- static void
- darwin_list_gdb_ports (const char *msg)
- {
-   mach_port_name_array_t names;
-   mach_port_type_array_t types;
-   unsigned int name_count, type_count;
-   kern_return_t result;
-   int i;
- 
-   result = mach_port_names (mach_task_self (),
- 			    &names, &name_count, &types, &type_count);
-   MACH_CHECK_ERROR (result);
- 
-   gdb_assert (name_count == type_count);
- 
-   printf_unfiltered (_("Ports for %s:"), msg);
-   for (i = 0; i < name_count; ++i)
-     printf_unfiltered (_(" 0x%04x"), names[i]);
-   printf_unfiltered (_("\n"));
- 
-   vm_deallocate (mach_task_self (), (vm_address_t) names,
-                  (name_count * sizeof (mach_port_t)));
-   vm_deallocate (mach_task_self (), (vm_address_t) types,
-                  (type_count * sizeof (mach_port_type_t)));
- }
- 
  void
  _initialize_darwin_info_commands (void)
  {
--- 843,848 ----
Index: darwin-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/darwin-nat.c,v
retrieving revision 1.17
diff -c -r1.17 darwin-nat.c
*** darwin-nat.c	1 Jan 2010 07:31:30 -0000	1.17
--- darwin-nat.c	4 Feb 2010 12:38:20 -0000
***************
*** 99,106 ****
  
  static void darwin_mourn_inferior (struct target_ops *ops);
  
- static int darwin_lookup_task (char *args, task_t * ptask, int *ppid);
- 
  static void darwin_kill_inferior (struct target_ops *ops);
  
  static void darwin_ptrace_me (void);
--- 99,104 ----
Index: machoread.c
===================================================================
RCS file: /cvs/src/src/gdb/machoread.c,v
retrieving revision 1.18
diff -c -r1.18 machoread.c
*** machoread.c	3 Feb 2010 14:13:16 -0000	1.18
--- machoread.c	4 Feb 2010 12:38:20 -0000
***************
*** 38,55 ****
  /* If non-zero displays debugging message.  */
  static int mach_o_debug_level = 0;
  
- static void
- macho_new_init (struct objfile *objfile)
- {
- }
- 
- static void
- macho_symfile_init (struct objfile *objfile)
- {
-   objfile->flags |= OBJF_REORDERED;
-   init_entry_point_info (objfile);
- }
- 
  /* Dwarf debugging information are never in the final executable.  They stay
     in object files and the executable contains the list of object files read
     during the link.
--- 38,43 ----
***************
*** 77,91 ****
  }
  oso_el;
  
! /* Vector of object files to be read after the executable.  */
  DEF_VEC_O (oso_el);
  static VEC (oso_el) *oso_vector;
  
! /*  Add a new OSO to the vector.  */
  
  static void
! macho_add_oso (const asymbol *oso_sym, int nbr_sections,
! 	       asymbol **symbols, bfd_vma *offsets)
  {
    oso_el el;
  
--- 65,92 ----
  }
  oso_el;
  
! /* Vector of object files to be read after the executable.  This is one
!    global variable but it's life-time is the one of macho_symfile_read.  */
  DEF_VEC_O (oso_el);
  static VEC (oso_el) *oso_vector;
  
! static void
! macho_new_init (struct objfile *objfile)
! {
! }
! 
! static void
! macho_symfile_init (struct objfile *objfile)
! {
!   objfile->flags |= OBJF_REORDERED;
!   init_entry_point_info (objfile);
! }
! 
! /*  Add a new OSO to the vector of OSO to load.  */
  
  static void
! macho_register_oso (const asymbol *oso_sym, int nbr_sections,
!                     asymbol **symbols, bfd_vma *offsets)
  {
    oso_el el;
  
***************
*** 135,142 ****
                /* An empty SO entry terminates a chunk for an OSO file.  */
  	      if ((sym->name == NULL || sym->name[0] == 0) && oso_file != NULL)
  		{
! 		  macho_add_oso (oso_file, nbr_sections,
!                                  first_symbol, first_offset);
  		  first_symbol = NULL;
  		  first_offset = NULL;
  		  oso_file = NULL;
--- 136,143 ----
                /* An empty SO entry terminates a chunk for an OSO file.  */
  	      if ((sym->name == NULL || sym->name[0] == 0) && oso_file != NULL)
  		{
! 		  macho_register_oso (oso_file, nbr_sections,
!                                       first_symbol, first_offset);
  		  first_symbol = NULL;
  		  first_offset = NULL;
  		  oso_file = NULL;
***************
*** 258,264 ****
  
    /* Just in case there is no trailing SO entry.  */
    if (oso_file != NULL)
!     macho_add_oso (oso_file, nbr_sections, first_symbol, first_offset);
  }
  
  /* If NAME describes an archive member (ie: ARCHIVE '(' MEMBER ')'),
--- 259,265 ----
  
    /* Just in case there is no trailing SO entry.  */
    if (oso_file != NULL)
!     macho_register_oso (oso_file, nbr_sections, first_symbol, first_offset);
  }
  
  /* If NAME describes an archive member (ie: ARCHIVE '(' MEMBER ')'),
***************
*** 303,309 ****
  
    if (mach_o_debug_level > 0)
      printf_unfiltered (_("Loading symbols from oso: %s\n"), oso->name);
!       
    if (!bfd_check_format (abfd, bfd_object))
      {
        warning (_("`%s': can't read symbols: %s."), oso->name,
--- 304,310 ----
  
    if (mach_o_debug_level > 0)
      printf_unfiltered (_("Loading symbols from oso: %s\n"), oso->name);
! 
    if (!bfd_check_format (abfd, bfd_object))
      {
        warning (_("`%s': can't read symbols: %s."), oso->name,
***************
*** 382,388 ****
  /* Read symbols from the vector of oso files.  */
  
  static void
! macho_oso_symfile (struct objfile *main_objfile, int symfile_flags)
  {
    int ix;
    VEC (oso_el) *vec;
--- 383,389 ----
  /* Read symbols from the vector of oso files.  */
  
  static void
! macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags)
  {
    int ix;
    VEC (oso_el) *vec;
***************
*** 684,690 ****
  
    /* Then the oso.  */
    if (oso_vector != NULL)
!     macho_oso_symfile (objfile, symfile_flags);
  }
  
  static void
--- 685,691 ----
  
    /* Then the oso.  */
    if (oso_vector != NULL)
!     macho_symfile_read_all_oso (objfile, symfile_flags);
  }
  
  static void


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