diff options
author | Mark Kettenis <kettenis@gnu.org> | 2002-05-17 23:06:10 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2002-05-17 23:06:10 +0000 |
commit | b2cac7a7bb00207f07fca46bfe30d61e3a586113 (patch) | |
tree | bc033038f7cb7fc9d3f398cd83e66420e447cb24 | |
parent | f6a44727d8355e891e2ddd6fdd4d79d8be5a4ea0 (diff) | |
download | gdb-b2cac7a7bb00207f07fca46bfe30d61e3a586113.tar.gz |
* corelow.c (core_open): Only call set_gdbarch_from_file if
exec_bfd is NULL.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/corelow.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 16f19e507bf..c94caff5e84 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 657cdc8ffc9..785b8e14323 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); |