Index: objfiles.h =================================================================== RCS file: /cvs/src/src/gdb/objfiles.h,v retrieving revision 1.64 diff -u -p -u -r1.64 objfiles.h --- objfiles.h 11 Sep 2009 18:51:31 -0000 1.64 +++ objfiles.h 14 Sep 2009 18:04:54 -0000 @@ -414,6 +414,12 @@ struct objfile #define OBJF_USERLOADED (1 << 3) /* User loaded */ +/* This objfile is not mapped into the process address space. We only have it + for its debug bits. One example is MACH-O ("other source") object + files. */ + +#define OBJF_NOT_MAPPED (1 << 4) /* Not mapped */ + /* The object file that the main symbol table was loaded from (e.g. the argument to the "symbol-file" or "file" command). */ Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.96 diff -u -p -u -r1.96 objfiles.c --- objfiles.c 14 Sep 2009 17:12:07 -0000 1.96 +++ objfiles.c 14 Sep 2009 18:04:54 -0000 @@ -1041,16 +1041,21 @@ update_section_map (struct obj_section * xfree (map); alloc_size = 0; - ALL_OBJSECTIONS (objfile, s) - if (insert_section_p (objfile->obfd, s->the_bfd_section)) - alloc_size += 1; + + ALL_OBJFILES (objfile) + if ((objfile->flags & OBJF_NOT_MAPPED) == 0) + ALL_OBJFILE_OSECTIONS (objfile, s) + if (insert_section_p (objfile->obfd, s->the_bfd_section)) + alloc_size += 1; map = xmalloc (alloc_size * sizeof (*map)); i = 0; - ALL_OBJSECTIONS (objfile, s) - if (insert_section_p (objfile->obfd, s->the_bfd_section)) - map[i++] = s; + ALL_OBJFILES (objfile) + if ((objfile->flags & OBJF_NOT_MAPPED) == 0) + ALL_OBJFILE_OSECTIONS (objfile, s) + if (insert_section_p (objfile->obfd, s->the_bfd_section)) + map[i++] = s; qsort (map, alloc_size, sizeof (*map), qsort_cmp); map_size = filter_debuginfo_sections(map, alloc_size); Index: machoread.c =================================================================== RCS file: /cvs/src/src/gdb/machoread.c,v retrieving revision 1.5 diff -u -p -u -r1.5 machoread.c --- machoread.c 19 Jun 2009 14:30:30 -0000 1.5 +++ machoread.c 14 Sep 2009 18:04:54 -0000 @@ -406,7 +406,8 @@ macho_oso_symfile (struct objfile *main_ bfd_close (member_bfd); } else - symbol_file_add_from_bfd (member_bfd, 0, addrs, 0); + symbol_file_add_from_bfd (member_bfd, SYMFILE_DEFER_BP_RESET, + addrs, OBJF_NOT_MAPPED); } else { @@ -429,7 +430,8 @@ macho_oso_symfile (struct objfile *main_ continue; } - symbol_file_add_from_bfd (abfd, 0, addrs, 0); + symbol_file_add_from_bfd (abfd, SYMFILE_DEFER_BP_RESET, addrs, + OBJF_NOT_MAPPED); } xfree (oso->symbols); xfree (oso->offsets); @@ -592,7 +594,7 @@ macho_symfile_read (struct objfile *objf oso_vector = NULL; /* Now recurse: read dwarf from dsym. */ - symbol_file_add_from_bfd (dsym_bfd, 0, NULL, 0); + symbol_file_add_from_bfd (dsym_bfd, 0, NULL, OBJF_NOT_MAPPED); /* Don't try to read dwarf2 from main file or shared libraries. */ return;