aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-05-17 23:06:10 +0000
committerMark Kettenis <kettenis@gnu.org>2002-05-17 23:06:10 +0000
commit2f1b59840e9d5daa1add3c43681940a8f748ff96 (patch)
treeba3d06b395633a8e040df4dfa0bb5691c430fc18 /gdb
parentf617d2b61f0dc2c2367f27d5497b4ea1c58d87f8 (diff)
downloadgdb-2f1b59840e9d5daa1add3c43681940a8f748ff96.zip
gdb-2f1b59840e9d5daa1add3c43681940a8f748ff96.tar.gz
gdb-2f1b59840e9d5daa1add3c43681940a8f748ff96.tar.bz2
* corelow.c (core_open): Only call set_gdbarch_from_file if
exec_bfd is NULL.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/corelow.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 16f19e5..c94caff 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-18 Mark Kettenis <kettenis@gnu.org>
+
+ * corelow.c (core_open): Only call set_gdbarch_from_file if
+ exec_bfd is NULL.
+
2002-05-17 Andrey Volkov <avolkov@transas.com>
* h8300-tdep.c: Add support of EXR register
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 657cdc8..785b8e1 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -321,7 +321,12 @@ core_open (char *filename, int from_tty)
error ("\"%s\": Can't find sections: %s",
bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ()));
- set_gdbarch_from_file (core_bfd);
+ /* If we have no exec file, try to set the architecture from the
+ core file. We don't do this unconditionally since an exec file
+ typically contains more information that helps us determine the
+ architecture than a core file. */
+ if (!exec_bfd)
+ set_gdbarch_from_file (core_bfd);
ontop = !push_target (&core_ops);
discard_cleanups (old_chain);