+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.
+
2010-02-04 Vladimir Prus <vladimir@codesourcery.com>
Include MI command in remotelog.
}
}
-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)
{
/* 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.
}
oso_el;
-/* Vector of object files to be read after the executable. */
+/* 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;
-/* Add a new OSO to the 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_add_oso (const asymbol *oso_sym, int nbr_sections,
- asymbol **symbols, bfd_vma *offsets)
+macho_register_oso (const asymbol *oso_sym, int nbr_sections,
+ asymbol **symbols, bfd_vma *offsets)
{
oso_el el;
/* 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);
+ macho_register_oso (oso_file, nbr_sections,
+ first_symbol, first_offset);
first_symbol = NULL;
first_offset = NULL;
oso_file = NULL;
/* Just in case there is no trailing SO entry. */
if (oso_file != NULL)
- macho_add_oso (oso_file, nbr_sections, first_symbol, first_offset);
+ macho_register_oso (oso_file, nbr_sections, first_symbol, first_offset);
}
/* If NAME describes an archive member (ie: ARCHIVE '(' MEMBER ')'),
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,
/* Read symbols from the vector of oso files. */
static void
-macho_oso_symfile (struct objfile *main_objfile, int symfile_flags)
+macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags)
{
int ix;
VEC (oso_el) *vec;
/* Then the oso. */
if (oso_vector != NULL)
- macho_oso_symfile (objfile, symfile_flags);
+ macho_symfile_read_all_oso (objfile, symfile_flags);
}
static void