S/390: Add missing gdb_prompt in s390-multiarch.exp
[deliverable/binutils-gdb.git] / gdb / exec.c
index c7370e3d40bf8758febf7f473c1ca53fc6e25a94..187c412725dc39dddfb25453dc6be14fba2a2bd3 100644 (file)
@@ -224,7 +224,7 @@ exec_file_attach (char *filename, int from_tty)
        }
 
       gdb_assert (exec_filename == NULL);
-      exec_filename = xstrdup (scratch_pathname);
+      exec_filename = gdb_realpath_keepfile (scratch_pathname);
 
       if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
        {
@@ -438,6 +438,51 @@ add_target_sections (void *owner,
     }
 }
 
+/* Add the sections of OBJFILE to the current set of target sections.  */
+
+void
+add_target_sections_of_objfile (struct objfile *objfile)
+{
+  struct target_section_table *table = current_target_sections;
+  struct obj_section *osect;
+  int space;
+  unsigned count = 0;
+  struct target_section *ts;
+
+  if (objfile == NULL)
+    return;
+
+  /* Compute the number of sections to add.  */
+  ALL_OBJFILE_OSECTIONS (objfile, osect)
+    {
+      if (bfd_get_section_size (osect->the_bfd_section) == 0)
+       continue;
+      count++;
+    }
+
+  if (count == 0)
+    return;
+
+  space = resize_section_table (table, count);
+
+  ts = table->sections + space;
+
+  ALL_OBJFILE_OSECTIONS (objfile, osect)
+    {
+      if (bfd_get_section_size (osect->the_bfd_section) == 0)
+       continue;
+
+      gdb_assert (ts < table->sections + space + count);
+
+      ts->addr = obj_section_addr (osect);
+      ts->endaddr = obj_section_endaddr (osect);
+      ts->the_bfd_section = osect->the_bfd_section;
+      ts->owner = (void *) objfile;
+
+      ts++;
+    }
+}
+
 /* Remove all target sections owned by OWNER.
    OWNER must be the same value passed to add_target_sections.  */
 
This page took 0.026255 seconds and 4 git commands to generate.