This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH, gdbsim] Avoid silly crash when no binary is loaded
- From: Luis Machado <lgustavo at codesourcery dot com>
- To: "'gdb-patches at sourceware dot org'" <gdb-patches at sourceware dot org>
- Date: Tue, 18 Jun 2013 17:49:39 -0300
- Subject: [PATCH, gdbsim] Avoid silly crash when no binary is loaded
- Reply-to: lgustavo at codesourcery dot com
Hi,
This patch prevents the long-standing crash scenario where we start
gdbsim and "run" without any binaries. Warnings are issued, but those
don't prevent the simulator from proceeding with garbage data.
Replacing those warnings with error calls seems to be the most
appropriate here.
Ok?
Luis
2013-06-18 Luis Machado <lgustavo@codesourcery.com>
* remote-sim.c (gdbsim_create_inferior): Replace warnings with
errors when no program is loaded.
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index fda3735..c04ce01 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -612,9 +612,9 @@ gdbsim_create_inferior (struct target_ops *target, char *exec_file, char *args,
char *arg_buf, **argv;
if (exec_file == 0 || exec_bfd == 0)
- warning (_("No executable file specified."));
+ error (_("No executable file specified."));
if (!sim_data->program_loaded)
- warning (_("No program loaded."));
+ error (_("No program loaded."));
if (remote_debug)
printf_filtered ("gdbsim_create_inferior: exec_file \"%s\", args \"%s\"\n",