others don't (or didn't - perhaphs they have all been deleted).  */
others don't (or didn't - perhaps they have all been deleted).  */
generic_load (char *args, int from_tty){  asection *s;  bfd *loadfile_bfd;  time_t start_time, end_time;	/* Start and end times of download */  char *filename;  struct cleanup *old_cleanups;  char *offptr;  struct load_section_data cbdata;  CORE_ADDR entry;  cbdata.load_offset = 0;	/* Offset to add to vma for each section. */  cbdata.write_count = 0;	/* Number of writes needed. */  cbdata.data_count = 0;	/* Number of bytes written to target memory. */  cbdata.total_size = 0;	/* Total size of all bfd sectors. */  /* Parse the input argument - the user can specify a load offset as     a second argument. */  filename = xmalloc (strlen (args) + 1);  old_cleanups = make_cleanup (xfree, filename);  strcpy (filename, args);  offptr = strchr (filename, ' ');  if (offptr != NULL)    {      char *endptr;      cbdata.load_offset = strtoul (offptr, &endptr, 0);      if (offptr == endptr)	error ("Invalid download offset:%s\n", offptr);      *offptr = '\0';    }  else    cbdata.load_offset = 0;  /* Open the file for loading. */  loadfile_bfd = bfd_openr (filename, gnutarget);  if (loadfile_bfd == NULL)    {      perror_with_name (filename);      return;    }  /* FIXME: should be checking for errors from bfd_close (for one thing,     on error it does not free all the storage associated with the     bfd).  */  make_cleanup_bfd_close (loadfile_bfd);  if (!bfd_check_format (loadfile_bfd, bfd_object))    {      error ("\"%s\" is not an object file: %s", filename,	     bfd_errmsg (bfd_get_error ()));    }  bfd_map_over_sections (loadfile_bfd, add_section_size_callback, 			 (void *) &cbdata.total_size);  start_time = time (NULL);  bfd_map_over_sections (loadfile_bfd, load_section_callback, &cbdata);  end_time = time (NULL);  entry = bfd_get_start_address (loadfile_bfd);  ui_out_text (uiout, "Start address ");  ui_out_field_fmt (uiout, "address", "0x%s", paddr_nz (entry));  ui_out_text (uiout, ", load size ");  ui_out_field_fmt (uiout, "load-size", "%lu", cbdata.data_count);  ui_out_text (uiout, "\n");  /* We were doing this in remote-mips.c, I suspect it is right     for other targets too.  */  write_pc (entry);  /* FIXME: are we supposed to call symbol_file_add or not?  According     to a comment from remote-mips.c (where a call to symbol_file_add     was commented out), making the call confuses GDB if more than one     file is loaded in.  Some targets do (e.g., remote-vx.c) but     others don't (or didn't - perhaphs they have all been deleted).  */  print_transfer_performance (gdb_stdout, cbdata.data_count, 			      cbdata.write_count, end_time - start_time);  do_cleanups (old_cleanups);}