-/* FIXME-now: if target is open when baud changes... */
- add_show_from_set (add_set_cmd ("remotebaud", no_class,
- var_zinteger, (char *)&sr_settings.baud_rate,
- "Set baud rate for remote serial I/O.\n\
-This value is used to set the speed of the serial port when debugging\n\
-using remote targets.", &setlist),
- &showlist);
+ asection *s;
+ struct cleanup *old_cleanups;
+ int delta = 4096;
+ char *buffer = xmalloc (delta);
+
+ abfd = bfd_openr (args, (char *) 0);
+
+ if (!abfd)
+ perror_with_name (args);
+
+ old_cleanups = make_cleanup (bfd_close, abfd);
+
+ QUIT;
+
+ if (!bfd_check_format (abfd, bfd_object))
+ error ("It doesn't seem to be an object file.\n");
+
+ for (s = abfd->sections; s && !quit_flag; s = s->next)
+ {
+ if (bfd_get_section_flags (abfd, s) & SEC_LOAD)
+ {
+ int i;
+ printf_filtered ("%s\t: 0x%4x .. 0x%4x ",
+ s->name, s->vma, s->vma + s->_raw_size);
+ fflush (stdout);
+ for (i = 0; i < s->_raw_size && !quit_flag; i += delta)
+ {
+ int sub_delta = delta;
+ if (sub_delta > s->_raw_size - i)
+ sub_delta = s->_raw_size - i;
+ QUIT;
+ bfd_get_section_contents (abfd, s, buffer, i, sub_delta);
+ target_write_memory (s->vma + i, buffer, sub_delta);
+ printf_filtered ("*");
+ fflush (stdout);
+ }
+ printf_filtered ("\n");
+ }
+ }