aboutsummaryrefslogtreecommitdiff
path: root/gdb/machoread.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-02-04 08:47:56 +0000
committerTristan Gingold <gingold@adacore.com>2009-02-04 08:47:56 +0000
commitcf1061c036950e2c75d7520eb33d7a1618e3a4ef (patch)
tree770550733f16a467d1ec6394a36d87b1ad58ca8a /gdb/machoread.c
parent7a848be1e44cec4b230c0a1d417953691d71558c (diff)
downloadgdb-cf1061c036950e2c75d7520eb33d7a1618e3a4ef.zip
gdb-cf1061c036950e2c75d7520eb33d7a1618e3a4ef.tar.gz
gdb-cf1061c036950e2c75d7520eb33d7a1618e3a4ef.tar.bz2
2009-02-04 Tristan Gingold <gingold@adacore.com>
* machoread.c (macho_symfile_read): Read minsymtab also from shared libraries. (macho_symfile_read): Try to read dwarf2 frame info from main object file, but not from OSO files. (macho_symfile_offsets): Update section names for latest BFD changes. * i386-darwin-tdep.c (i386_darwin_init_abi): Call set_solib_ops. (x86_darwin_init_abi_64): Ditto. * solib-darwin.c: New file. * solib-darwin.h: New file. * configure.tgt: Add solib.o solib-darwin.o for Darwin.
Diffstat (limited to 'gdb/machoread.c')
-rw-r--r--gdb/machoread.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 56df33f..d8d3bd2 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -538,7 +538,7 @@ macho_symfile_read (struct objfile *objfile, int mainline)
/* Get symbols from the symbol table only if the file is an executable.
The symbol table of object files is not relocated and is expected to
be in the executable. */
- if (bfd_get_file_flags (abfd) & EXEC_P)
+ if (bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC))
{
/* Process the normal symbol table first. */
storage_needed = bfd_get_symtab_upper_bound (objfile->obfd);
@@ -566,6 +566,12 @@ macho_symfile_read (struct objfile *objfile, int mainline)
install_minimal_symbols (objfile);
+ /* Try to read .eh_frame / .debug_frame. */
+ /* First, locate these sections. We ignore the result status
+ as it only checks for debug info. */
+ dwarf2_has_info (objfile);
+ dwarf2_build_frame_info (objfile);
+
/* Check for DSYM file. */
dsym_bfd = macho_check_dsym (objfile);
if (dsym_bfd != NULL)
@@ -588,7 +594,7 @@ macho_symfile_read (struct objfile *objfile, int mainline)
/* Now recurse: read dwarf from dsym. */
symbol_file_add_from_bfd (dsym_bfd, 0, NULL, 0, 0);
- /* Don't try to read dwarf2 from main file. */
+ /* Don't try to read dwarf2 from main file or shared libraries. */
return;
}
}
@@ -599,9 +605,8 @@ macho_symfile_read (struct objfile *objfile, int mainline)
dwarf2_build_psymtabs (objfile, mainline);
}
- /* FIXME: kettenis/20030504: This still needs to be integrated with
- dwarf2read.c in a better way. */
- dwarf2_build_frame_info (objfile);
+ /* Do not try to read .eh_frame/.debug_frame as they are not relocated
+ and dwarf2_build_frame_info cannot deal with unrelocated sections. */
/* Then the oso. */
if (oso_vector != NULL)
@@ -661,10 +666,11 @@ macho_symfile_offsets (struct objfile *objfile,
{
const char *bfd_sect_name = osect->the_bfd_section->name;
int sect_index = osect->the_bfd_section->index;
-
- if (strcmp (bfd_sect_name, "LC_SEGMENT.__TEXT") == 0)
- objfile->sect_index_text = sect_index;
- else if (strcmp (bfd_sect_name, "LC_SEGMENT.__TEXT.__text") == 0)
+
+ if (strncmp (bfd_sect_name, "LC_SEGMENT.", 11) == 0)
+ bfd_sect_name += 11;
+ if (strcmp (bfd_sect_name, "__TEXT") == 0
+ || strcmp (bfd_sect_name, "__TEXT.__text") == 0)
objfile->sect_index_text = sect_index;
}
}