aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-02-16 18:30:43 +0000
committerMike Frysinger <vapier@gentoo.org>2012-02-16 18:30:43 +0000
commitddd60447d562534f4bfe3f9bd89b9943204861c7 (patch)
treee9036169bc2e4e3c5b349de3ac43fe267251b3d9 /gdb/remote-sim.c
parentb0d32fb61e974e283300e836c34cfaa94ab1c03d (diff)
downloadgdb-ddd60447d562534f4bfe3f9bd89b9943204861c7.zip
gdb-ddd60447d562534f4bfe3f9bd89b9943204861c7.tar.gz
gdb-ddd60447d562534f4bfe3f9bd89b9943204861c7.tar.bz2
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 2a586e5..ee73cce 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));