Index: corelow.c =================================================================== RCS file: /cvs/src/src/gdb/corelow.c,v retrieving revision 1.21 diff -u -r1.21 corelow.c --- corelow.c 5 May 2002 01:15:13 -0000 1.21 +++ corelow.c 10 May 2002 04:14:05 -0000 @@ -264,6 +264,7 @@ bfd *temp_bfd; int ontop; int scratch_chan; + const struct bfd_arch_info *current_arch_info; target_preopen (from_tty); if (!filename) @@ -321,7 +322,13 @@ error ("\"%s\": Can't find sections: %s", bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ())); - set_gdbarch_from_file (core_bfd); + /* If the core's arch is known and different from the current, + reinitialize gdbarch based on the core file. */ + + current_arch_info = gdbarch_bfd_arch_info (current_gdbarch); + if (core_bfd->arch_info->arch != bfd_arch_unknown + && core_bfd->arch_info->arch != current_arch_info->arch) + set_gdbarch_from_file (core_bfd); ontop = !push_target (&core_ops); discard_cleanups (old_chain);