Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH, gdbsim] Avoid silly crash when no binary is loaded
@ 2013-06-18 21:09 Luis Machado
  2013-06-19 11:43 ` Pedro Alves
  0 siblings, 1 reply; 11+ messages in thread
From: Luis Machado @ 2013-06-18 21:09 UTC (permalink / raw)
  To: 'gdb-patches@sourceware.org'

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

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

[-- Attachment #2: sim_crash.diff --]
[-- Type: text/x-patch, Size: 764 bytes --]

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",

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-06-21 10:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 21:09 [PATCH, gdbsim] Avoid silly crash when no binary is loaded Luis Machado
2013-06-19 11:43 ` Pedro Alves
2013-06-19 12:20   ` Luis Machado
2013-06-19 14:53     ` Pedro Alves
2013-06-19 15:20       ` Luis Machado
2013-06-20 13:39         ` Luis Machado
2013-06-20 17:50     ` Mike Frysinger
2013-06-20 18:34       ` Pedro Alves
2013-06-20 21:33       ` Stan Shebs
2013-06-20 22:00         ` Mike Frysinger
2013-06-21 10:58           ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox