aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-08-04 14:44:56 +0100
committerGary Benson <gbenson@redhat.com>2014-08-29 10:12:03 +0100
commitb1ec390e096983dea311a853c412494a4991153e (patch)
tree740ba40d37d081e57a570a48a914967dc081c4d7
parentfd0ef3dda9fa7af181d059e4b3e26c17c1385c0d (diff)
downloadgdb-b1ec390e096983dea311a853c412494a4991153e.zip
gdb-b1ec390e096983dea311a853c412494a4991153e.tar.gz
gdb-b1ec390e096983dea311a853c412494a4991153e.tar.bz2
Replace hardwired error handler in go32_create_inferior
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 _().
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/go32-nat.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8898962..dd5e080 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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
pair with a call to error. Wrap the message with _().
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 727f810..ed54247 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -638,6 +638,7 @@ go32_create_inferior (struct target_ops *ops, char *exec_file,
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. */
@@ -689,15 +690,14 @@ go32_create_inferior (struct target_ops *ops, char *exec_file,
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 ();