* inftarg.c (child_create_inferior, child_attach,
[deliverable/binutils-gdb.git] / gdb / xcoffexec.c
index b17d87464a678262ce40071f4b1b9c225f3d2ab2..302b53985f9328dcd2d4706a99473a318755da96 100644 (file)
@@ -63,7 +63,6 @@ extern int info_verbose;
 bfd *exec_bfd;                 /* needed by core.c     */
 
 extern char *getenv();
-extern void child_create_inferior (), child_attach ();
 extern void add_syms_addr_command ();
 extern void symbol_file_command ();
 static void exec_files_info();
@@ -340,11 +339,12 @@ map_vmap (bfd *bf, bfd *arch)
     obj = allocate_objfile (bf, 0);
 
 #if 0
-    This is only needed if we want to load shared libraries no matter what.
-    Since we provide the choice of incremental loading of shared objects now,
-    we don't have to load them as default anymore.
+    /* This is only needed if we want to load shared libraries no matter what.
+       Since we provide the choice of incremental loading of shared objects
+       now, we do not have to load them as default anymore. */
     
     syms_from_objfile (obj, 0, 0, 0);
+    new_symfile_objfile (obj, 0, 0);
 #endif
   }
 
@@ -444,16 +444,6 @@ struct stat *vip;
     }
 
   if (vp->tstart != old_start) {
-
-#if 0
-  We don't have a valid `objfile' at this point. This is moved into the
-  previous statement; ALL_OBJFILES() for-loop.
-
-    ALL_MSYMBOLS (objfile, msymbol)
-      if (msymbol->address < TEXT_SEGMENT_BASE)
-       msymbol -> address += vp->tstart - old_start;
-#endif /* 0 */
-
     /* breakpoints need to be relocated as well. */
     fixup_breakpoints (0, TEXT_SEGMENT_BASE, vp->tstart - old_start);
   }
@@ -564,7 +554,7 @@ register struct ld_info *ldi; {
        register char *mem, *objname;
 
        /* This ldi structure was allocated using alloca() in 
-          aixcoff_relocate_symtab(). Now we need to have persistent object 
+          xcoff_relocate_symtab(). Now we need to have persistent object 
           and member names, so we should save them. */
 
        mem = ldi->ldinfo_filename + strlen(ldi->ldinfo_filename) + 1;
@@ -628,24 +618,29 @@ register struct ld_info *ldi; {
 vmap_exec ()
 {
   static bfd *execbfd;
+  int i;
+
   if (execbfd == exec_bfd)
     return;
 
   execbfd = exec_bfd;
 
-  /* First exec section is `.text', second is `.data'. If this is changed,
-     then this routine will choke. */
+  if (!vmap || !exec_ops.to_sections)
+    error ("vmap_exec: vmap or exec_ops.to_sections == 0\n");
 
-  if (!vmap || !exec_ops.to_sections ||
-       strcmp (exec_ops.to_sections[0].sec_ptr->name, ".text") ||
-       strcmp (exec_ops.to_sections[1].sec_ptr->name, ".data"))
-
-    fatal ("aix: Improper exec_ops sections.");
-
-  exec_ops.to_sections [0].addr += vmap->tstart;
-  exec_ops.to_sections [0].endaddr += vmap->tstart;
-  exec_ops.to_sections [1].addr += vmap->dstart;
-  exec_ops.to_sections [1].endaddr += vmap->dstart;
+  for (i=0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++)
+    {
+      if (strcmp(".text", exec_ops.to_sections[i].sec_ptr->name) == 0)
+       {
+         exec_ops.to_sections[i].addr += vmap->tstart;
+         exec_ops.to_sections[i].endaddr += vmap->tstart;
+       }
+      else if (strcmp(".data", exec_ops.to_sections[i].sec_ptr->name) == 0)
+       {
+         exec_ops.to_sections[i].addr += vmap->dstart;
+         exec_ops.to_sections[i].endaddr += vmap->dstart;
+       }
+    }
 }
 
 
@@ -993,16 +988,17 @@ struct target_ops exec_ops = {
        "Use an executable file as a target.\n\
 Specify the filename of the executable file.",
        exec_file_command, exec_close, /* open, close */
-       child_attach, 0, 0, 0, /* attach, detach, resume, wait, */
+       find_default_attach, 0, 0, 0, /* attach, detach, resume, wait, */
        0, 0, /* fetch_registers, store_registers, */
-       0, 0, 0, /* prepare_to_store, conv_to, conv_from, */
+       0, /* prepare_to_store */
        xfer_memory, exec_files_info,
        0, 0, /* insert_breakpoint, remove_breakpoint, */
        0, 0, 0, 0, 0, /* terminal stuff */
        0, 0, /* kill, load */
        0, /* lookup sym */
-       child_create_inferior,
+       find_default_create_inferior,
        0, /* mourn_inferior */
+       0, /* can_run */
        file_stratum, 0, /* next */
        0, 1, 0, 0, 0,  /* all mem, mem, stack, regs, exec */
        0, 0,                   /* section pointers */
This page took 0.025014 seconds and 4 git commands to generate.