summaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-02-16 18:30:35 +0000
committerMike Frysinger <vapier@gentoo.org>2012-02-16 18:30:35 +0000
commit1c7ba959058c33d53d39b7551f28ae11fe897781 (patch)
tree7d6b52806d76b22fb317d79094995fcfd3553faf /gdb/remote-sim.c
parent9ba6fb7f0b383d2f19536d8224fe4e692bd30e2d (diff)
downloadgdb-1c7ba959058c33d53d39b7551f28ae11fe897781.tar.gz
gdb: sim: check return value of sim_create_inferior
The current gdbsim_create_inferior func doesn't check the return value of sim_create_inferior which can be problematic when that func doesn't return success. So, if it fails, call error() and be done. Reported-by: Richard Stuckey <richard.stuckey@arc.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 2a586e5e80e..ee73cce47c5 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -641,7 +641,10 @@ gdbsim_create_inferior (struct target_ops *target, char *exec_file, char *args,
}
else
argv = NULL;
- sim_create_inferior (sim_data->gdbsim_desc, exec_bfd, argv, env);
+
+ if (sim_create_inferior (sim_data->gdbsim_desc, exec_bfd, argv, env)
+ != SIM_RC_OK)
+ error (_("Unable to create sim inferior."));
inferior_ptid = sim_data->remote_sim_ptid;
inferior_appeared (current_inferior (), ptid_get_pid (inferior_ptid));