2009-12-15 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Tue, 15 Dec 2009 09:56:23 +0000 (09:56 +0000)
committerTristan Gingold <gingold@adacore.com>
Tue, 15 Dec 2009 09:56:23 +0000 (09:56 +0000)
* machoread.c (macho_symfile_read): Set section size of dsym bfd
from main bfd.

gdb/ChangeLog
gdb/machoread.c

index d73ddd38b0aa3ddd428a52cd252d5ec032e1c392..024ab277598a01cd1b9bd60c26dfcb6bda38b8f2 100644 (file)
@@ -1,3 +1,8 @@
+2009-12-15  Tristan Gingold  <gingold@adacore.com>
+
+       * machoread.c (macho_symfile_read): Set section size of dsym bfd
+       from main bfd.
+
 2009-12-15  Tristan Gingold  <gingold@adacore.com>
 
         * machoread.c (macho_check_dsym): Read uuid directly from load command
index 0194ee521620a9e1b4eec4c881a374a46e751492..12fefaf1e09f068ab62eab060b8b3f296d800cde 100644 (file)
@@ -626,6 +626,7 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags)
        {
          int ix;
          oso_el *oso;
+          struct bfd_section *asect, *dsect;
 
          if (mach_o_debug_level > 0)
            printf_unfiltered (_("dsym file found\n"));
@@ -639,6 +640,17 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags)
          VEC_free (oso_el, oso_vector);
          oso_vector = NULL;
 
+          /* Set dsym section size.  */
+          for (asect = objfile->obfd->sections, dsect = dsym_bfd->sections;
+               asect && dsect;
+               asect = asect->next, dsect = dsect->next)
+            {
+              if (strcmp (asect->name, dsect->name) != 0)
+                break;
+              bfd_set_section_size (dsym_bfd, dsect,
+                                    bfd_get_section_size (asect));
+            }
+
          /* Add the dsym file as a separate file.  */
           symbol_file_add_separate (dsym_bfd, symfile_flags, objfile);