diff options
author | Hui Zhu <teawater@gmail.com> | 2010-02-05 02:22:39 +0000 |
---|---|---|
committer | Hui Zhu <teawater@gmail.com> | 2010-02-05 02:22:39 +0000 |
commit | d18b8b7a0759b26ebc14eab4e95f643e142a24de (patch) | |
tree | 3ed27c3dcec9f42a29c79f1da9b5eee881dc0508 /gdb/exec.c | |
parent | 6cfaf60bc2581b5ef9028a4157d203adbd2ae9c2 (diff) | |
download | gdb-d18b8b7a0759b26ebc14eab4e95f643e142a24de.zip gdb-d18b8b7a0759b26ebc14eab4e95f643e142a24de.tar.gz gdb-d18b8b7a0759b26ebc14eab4e95f643e142a24de.tar.bz2 |
2010-02-05 Hui Zhu <teawater@gmail.com>
* defs.h (gdb_bfd_errmsg): New extern.
* exec.c (exec_file_attach): Change bfd_errmsg to
gdb_bfd_errmsg.
* utils.c (AMBIGUOUS_MESS1): New macro.
(AMBIGUOUS_MESS2): New macro.
(gdb_bfd_errmsg): New function.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r-- | gdb/exec.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -219,6 +219,7 @@ exec_file_attach (char *filename, int from_tty) char *scratch_pathname; int scratch_chan; struct target_section *sections = NULL, *sections_end = NULL; + char **matching; scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename, write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, @@ -253,13 +254,14 @@ exec_file_attach (char *filename, int from_tty) scratch_pathname = xstrdup (scratch_pathname); cleanups = make_cleanup (xfree, scratch_pathname); - if (!bfd_check_format (exec_bfd, bfd_object)) + if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { /* Make sure to close exec_bfd, or else "run" might try to use it. */ exec_close (); error (_("\"%s\": not in executable format: %s"), - scratch_pathname, bfd_errmsg (bfd_get_error ())); + scratch_pathname, + gdb_bfd_errmsg (bfd_get_error (), matching)); } /* FIXME - This should only be run for RS6000, but the ifdef is a poor |