* symfile.h (sym_fns), symfile.c (find_sym_fns), xcoffread.c,
authorJim Kingdon <jkingdon@engr.sgi.com>
Sun, 31 Oct 1993 18:54:28 +0000 (18:54 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sun, 31 Oct 1993 18:54:28 +0000 (18:54 +0000)
coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c:
Change from using bfd target name to using the flavour.

gdb/ChangeLog
gdb/coffread.c
gdb/dbxread.c
gdb/elfread.c
gdb/mipsread.c
gdb/nlmread.c
gdb/paread.c
gdb/symfile.c
gdb/xcoffread.c

index 270b573be452650548da0c8c2b70179c6945165b..88dcf3f5c27ae0bd8ffb74d4fc230c573c21fe15 100644 (file)
@@ -1,5 +1,9 @@
 Sun Oct 31 09:28:46 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
+       * symfile.h (sym_fns), symfile.c (find_sym_fns), xcoffread.c,
+       coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c:
+       Change from using bfd target name to using the flavour.
+
        * objfiles.h, infcmd.c, symfile.c: Add comments about how various
        objfiles get created and when we should blow them away.
 
index 102d752fcd9e33ea6c6c33e1c8b9bc81123a57a7..26d60c135db0d5df2609d61d2c3abe9270aa03b0 100644 (file)
@@ -2062,8 +2062,7 @@ coff_symfile_offsets (objfile, addr)
 
 static struct sym_fns coff_sym_fns =
 {
-  "coff",              /* sym_name: name or name prefix of BFD target type */
-  4,                   /* sym_namelen: number of significant sym_name chars */
+  bfd_target_coff_flavour,
   coff_new_init,       /* sym_new_init: init anything gbl to entire symtab */
   coff_symfile_init,   /* sym_init: read initial info, setup for sym_read() */
   coff_symfile_read,   /* sym_read: read a symbol file into symtab */
index d423eec5e6e4e0aaf63e2ee410e3b44ea08caa97..b3c08d157dbe48ca1d4bf41e7f5421843fc95e8a 100644 (file)
@@ -2188,36 +2188,9 @@ dbx_symfile_offsets (objfile, addr)
   return section_offsets;
 }
 \f
-/* Register our willingness to decode symbols for SunOS and a.out and
-   NetBSD and b.out files handled by BFD... */
-static struct sym_fns sunos_sym_fns =
-{
-  "sunOs",             /* sym_name: name or name prefix of BFD target type */
-  6,                   /* sym_namelen: number of significant sym_name chars */
-  dbx_new_init,                /* sym_new_init: init anything gbl to entire symtab */
-  dbx_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
-  dbx_symfile_read,    /* sym_read: read a symbol file into symtab */
-  dbx_symfile_finish,  /* sym_finish: finished with file, cleanup */
-  dbx_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
-  NULL                 /* next: pointer to next struct sym_fns */
-};
-
 static struct sym_fns aout_sym_fns =
 {
-  "a.out",             /* sym_name: name or name prefix of BFD target type */
-  5,                   /* sym_namelen: number of significant sym_name chars */
-  dbx_new_init,                /* sym_new_init: init anything gbl to entire symtab */
-  dbx_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
-  dbx_symfile_read,    /* sym_read: read a symbol file into symtab */
-  dbx_symfile_finish,  /* sym_finish: finished with file, cleanup */
-  dbx_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
-  NULL                 /* next: pointer to next struct sym_fns */
-};
-
-static struct sym_fns bout_sym_fns =
-{
-  "b.out",             /* sym_name: name or name prefix of BFD target type */
-  5,                   /* sym_namelen: number of significant sym_name chars */
+  bfd_target_aout_flavour,
   dbx_new_init,                /* sym_new_init: init anything gbl to entire symtab */
   dbx_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
   dbx_symfile_read,    /* sym_read: read a symbol file into symtab */
@@ -2229,7 +2202,5 @@ static struct sym_fns bout_sym_fns =
 void
 _initialize_dbxread ()
 {
-  add_symtab_fns(&sunos_sym_fns);
   add_symtab_fns(&aout_sym_fns);
-  add_symtab_fns(&bout_sym_fns);
 }
index bbf4655fd26b02a2862e635e35c34919c4aad15f..1a0eee5c2a8eb41746e01ea0d87396e559d1584f 100644 (file)
@@ -699,8 +699,7 @@ elfstab_offset_sections (objfile, pst)
 
 static struct sym_fns elf_sym_fns =
 {
-  "elf",               /* sym_name: name or name prefix of BFD target type */
-  3,                   /* sym_namelen: number of significant sym_name chars */
+  bfd_target_elf_flavour,
   elf_new_init,                /* sym_new_init: init anything gbl to entire symtab */
   elf_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
   elf_symfile_read,    /* sym_read: read a symbol file into symtab */
index eb19789c67bc5d5cf162d67a86896dcaf5549cc4..3a744e8fb7cca6ed3b1f4c714ab95c9936ddcf35 100644 (file)
@@ -3633,8 +3633,7 @@ mipscoff_symfile_offsets (objfile, addr)
 
 static struct sym_fns ecoff_sym_fns =
 {
-  "ecoff",                     /* sym_name: name or name prefix of BFD target type */
-  5,                           /* sym_namelen: number of significant sym_name chars */
+  bfd_target_ecoff_flavour,
   mipscoff_new_init,           /* sym_new_init: init anything gbl to entire symtab */
   mipscoff_symfile_init,       /* sym_init: read initial info, setup for sym_read() */
   mipscoff_symfile_read,       /* sym_read: read a symbol file into symtab */
index 2ce4c2e277004ffd7de3f07124720675c1f04dee..f3455039dd12b11cdd6597093678584edc3d87db 100644 (file)
@@ -286,8 +286,7 @@ nlm_symfile_offsets (objfile, addr)
 
 static struct sym_fns nlm_sym_fns =
 {
-  "nlm",               /* sym_name: name or name prefix of BFD target type */
-  3,                   /* sym_namelen: number of significant sym_name chars */
+  bfd_target_nlm_flavour,
   nlm_new_init,                /* sym_new_init: init anything gbl to entire symtab */
   nlm_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
   nlm_symfile_read,    /* sym_read: read a symbol file into symtab */
index ce19622991db971f7052d5617bb4d668f6adbed4..843e3723330442a17afc649c3042b61843d401f6 100644 (file)
@@ -504,8 +504,7 @@ pa_symfile_offsets (objfile, addr)
 
 static struct sym_fns pa_sym_fns =
 {
-  "som",               /* sym_name: name or name prefix of BFD target type */
-  3,                   /* sym_namelen: number of significant sym_name chars */
+  bfd_target_som_flavour
   pa_new_init,         /* sym_new_init: init anything gbl to entire symtab */
   pa_symfile_init,     /* sym_init: read initial info, setup for sym_read() */
   pa_symfile_read,     /* sym_read: read a symbol file into symtab */
index 8430ae9438c4b50582dcf73cfc4e29be4abeca5d..fd8298dde766cef9d4c5657b01b657ffbb1d151c 100644 (file)
@@ -796,11 +796,15 @@ find_sym_fns (objfile)
      struct objfile *objfile;
 {
   struct sym_fns *sf;
+  enum bfd_flavour our_flavour = bfd_get_flavour (objfile -> obfd);
+
+  /* Special kludge for RS/6000.  See xcoffread.c.  */
+  if (STREQ (bfd_get_target (objfile -> obfd), "aixcoff-rs6000"))
+    our_flavour = (enum bfd_flavour)-1;
 
   for (sf = symtab_fns; sf != NULL; sf = sf -> next)
     {
-      if (strncmp (bfd_get_target (objfile -> obfd),
-                   sf -> sym_name, sf -> sym_namelen) == 0)
+      if (our_flavour == sf -> sym_flavour)
        {
          objfile -> sf = sf;
          return;
index e93991f7a3992ea4da5f591e1c446bed0f6afd94..5e0df413f5b87edc1d198e25346f3557140b8d97 100644 (file)
@@ -2140,12 +2140,20 @@ xcoff_symfile_offsets (objfile, addr)
   
   return section_offsets;
 }
-/* Register our ability to parse symbols for xcoff BFD files. */
+
+/* Register our ability to parse symbols for xcoff BFD files.  */
 
 static struct sym_fns xcoff_sym_fns =
 {
-  "aixcoff-rs6000",    /* sym_name: name or name prefix of BFD target type */
-  15,                  /* sym_namelen: number of significant sym_name chars */
+
+  /* Because the bfd uses coff_flavour, we need to specially kludge
+     the flavour.  FIXME: coff and xcoff and fundamentally similar
+     except for debug format, and we should see if we can merge this
+     file with coffread.c.  For example, the extra storage classes
+     used for stabs could presumably be recognized in any COFF file.  */
+
+  (bfd_flavour)-1,
+
   xcoff_new_init,      /* sym_new_init: init anything gbl to entire symtab */
   xcoff_symfile_init,  /* sym_init: read initial info, setup for sym_read() */
   xcoff_symfile_read,  /* sym_read: read a symbol file into symtab */
This page took 0.034561 seconds and 4 git commands to generate.