go32_create_inferior invokes a hardwired fprintf/exit error handler
if v2loadimage fails. I could find no reason for this other than that
the block seems to have been copy-and-pasted from v2loadimage's
manpage. This commit replaces the hardwired handler with a call to
error.
gdb/ChangeLog:
* go32-nat.c (go32_create_inferior): Replace a fprintf/
exit pair with a call to error. Wrap the message with _().
+2014-08-29 Gary Benson <gbenson@redhat.com>
+
+ * go32-nat.c (go32_create_inferior): Replace a fprintf/
+ exit pair with a call to error. Wrap the message with _().
+
2014-08-29 Gary Benson <gbenson@redhat.com>
* main.c (captured_main): Replace a fprintf/exit
char **env_save = environ;
size_t cmdlen;
struct inferior *inf;
+ int result;
/* If no exec file handed to us, get it from the exec-file command -- with
a good, common error message if none is specified. */
environ = env;
- if (v2loadimage (exec_file, cmdline, start_state))
- {
- environ = env_save;
- printf_unfiltered ("Load failed for image %s\n", exec_file);
- exit (1);
- }
+ result = v2loadimage (exec_file, cmdline, start_state);
+
environ = env_save;
xfree (cmdline);
+ if (result != 0)
+ error (_("Load failed for image %s", exec_file);
+
edi_init (start_state);
#if __DJGPP_MINOR__ < 3
save_npx ();