diff mbox

sim: parse_args: display getopt error ourselves [committed]

Message ID 1451876922-25292-1-git-send-email-vapier@gentoo.org
State Committed
Headers show

Commit Message

Mike Frysinger Jan. 4, 2016, 3:08 a.m. UTC
Fix a long standing todo where we let getopt write directly to stderr
when an invalid option is passed.  Use the sim io funcs instead as they
go through the filtered callbacks that gdb wants.
---
 sim/arm/ChangeLog        |  4 ++++
 sim/arm/wrapper.c        |  4 +---
 sim/avr/ChangeLog        |  4 ++++
 sim/avr/interp.c         |  4 +---
 sim/bfin/ChangeLog       |  4 ++++
 sim/bfin/interp.c        |  4 +---
 sim/common/ChangeLog     |  6 ++++++
 sim/common/sim-options.c | 28 +++++++++++++++++++++++++++-
 sim/cr16/ChangeLog       |  4 ++++
 sim/cr16/interp.c        |  4 +---
 sim/cris/ChangeLog       |  4 ++++
 sim/cris/sim-if.c        |  4 +---
 sim/d10v/ChangeLog       |  4 ++++
 sim/d10v/interp.c        |  4 +---
 sim/frv/ChangeLog        |  4 ++++
 sim/frv/sim-if.c         |  4 +---
 sim/ft32/ChangeLog       |  4 ++++
 sim/ft32/interp.c        |  4 +---
 sim/h8300/ChangeLog      |  4 ++++
 sim/h8300/compile.c      |  4 +---
 sim/iq2000/ChangeLog     |  4 ++++
 sim/iq2000/sim-if.c      |  4 +---
 sim/lm32/ChangeLog       |  4 ++++
 sim/lm32/sim-if.c        |  4 +---
 sim/m32r/ChangeLog       |  4 ++++
 sim/m32r/sim-if.c        |  4 +---
 sim/m68hc11/ChangeLog    |  4 ++++
 sim/m68hc11/interp.c     |  4 +---
 sim/mcore/ChangeLog      |  4 ++++
 sim/mcore/interp.c       |  4 +---
 sim/microblaze/ChangeLog |  4 ++++
 sim/microblaze/interp.c  |  4 +---
 sim/mips/ChangeLog       |  4 ++++
 sim/mips/interp.c        |  4 +---
 sim/mn10300/ChangeLog    |  4 ++++
 sim/mn10300/interp.c     |  4 +---
 sim/moxie/ChangeLog      |  4 ++++
 sim/moxie/interp.c       |  4 +---
 sim/sh/ChangeLog         |  4 ++++
 sim/sh/interp.c          |  4 +---
 sim/sh64/ChangeLog       |  4 ++++
 sim/sh64/sim-if.c        |  4 +---
 sim/v850/ChangeLog       |  4 ++++
 sim/v850/interp.c        |  4 +---
 44 files changed, 138 insertions(+), 64 deletions(-)
diff mbox

Patch

diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog
index e9346c1..2e846ef 100644
--- a/sim/arm/ChangeLog
+++ b/sim/arm/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* wrapper.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* wrapper.c (sim_target_parse_arg_array): Replace for loop with
 	a call to countargv.
 
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index 274b294..9e61ed6 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -819,9 +819,7 @@  sim_open (SIM_OPEN_KIND kind,
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/avr/ChangeLog b/sim/avr/ChangeLog
index 7107554..27d1e27 100644
--- a/sim/avr/ChangeLog
+++ b/sim/avr/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/avr/interp.c b/sim/avr/interp.c
index 91b9792..f33de1c 100644
--- a/sim/avr/interp.c
+++ b/sim/avr/interp.c
@@ -1704,9 +1704,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 1bbef04..67612b2 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* TODO: Delete file.
 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index 84fb085..ad86500 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -755,9 +755,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *callback,
   e_sim_add_option_table (sd, bfin_mmu_options);
   e_sim_add_option_table (sd, bfin_mach_options);
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index d358491..9de5238 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,11 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-options.c (sim_parse_args): Declare local save_opterr.  Save
+	opterr state to it before calling getopt_long and restore afterwards.
+	Set opterr to 0.  When optc is '?', call sim_io_eprintf.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* hw-device.h (device): Delete commented typedef.
 	* sim-basics.h (device): Delete typedef.
 
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index 88663f7..f662b73 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -460,7 +460,7 @@  dup_arg_p (const char *arg)
 SIM_RC
 sim_parse_args (SIM_DESC sd, char **argv)
 {
-  int c, i, argc, num_opts;
+  int c, i, argc, num_opts, save_opterr;
   char *p, *short_options;
   /* The `val' option struct entry is dynamically assigned for options that
      only come in the long form.  ORIG_VAL is used to get the original value
@@ -583,6 +583,11 @@  sim_parse_args (SIM_DESC sd, char **argv)
   /* Ensure getopt is initialized.  */
   optind = 0;
 
+  /* Do not lot getopt throw errors for us.  But don't mess with the state for
+     any callers higher up by saving/restoring it.  */
+  save_opterr = opterr;
+  opterr = 0;
+
   while (1)
     {
       int longind, optc;
@@ -596,6 +601,25 @@  sim_parse_args (SIM_DESC sd, char **argv)
 	}
       if (optc == '?')
 	{
+	  /* If getopt rejects a short option, optopt is set to the bad char.
+	     If it rejects a long option, we have to look at optind.  In the
+	     short option case, argv could be multiple short options.  */
+	  const char *badopt;
+	  char optbuf[3];
+
+	  if (optopt)
+	    {
+	      sprintf (optbuf, "-%c", optopt);
+	      badopt = optbuf;
+	    }
+	  else
+	    badopt = argv[optind - 1];
+
+	  sim_io_eprintf (sd,
+			  "%s: unrecognized option: %s\n"
+			  "Use --help for a complete list of options.\n",
+			  STATE_MY_NAME (sd), badopt);
+
 	  result = SIM_RC_FAIL;
 	  break;
 	}
@@ -607,6 +631,8 @@  sim_parse_args (SIM_DESC sd, char **argv)
 	}
     }
 
+  opterr = save_opterr;
+
   free (long_options);
   free (short_options);
   free (handlers);
diff --git a/sim/cr16/ChangeLog b/sim/cr16/ChangeLog
index 1e4e737..dc56bb4 100644
--- a/sim/cr16/ChangeLog
+++ b/sim/cr16/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c
index a0e30f5..9aa2062 100644
--- a/sim/cr16/interp.c
+++ b/sim/cr16/interp.c
@@ -406,9 +406,7 @@  sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd,
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index 6474681..7f8ea85 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-if.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* sim-main.h (cris_devices): Delete.
 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index ac4ab45..3b0b546 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -680,9 +680,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index e745678..5c647bf 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 807c5c2..a49cd52 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -769,9 +769,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 7a6b86a..0be8512 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-if.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* TODO: Delete file.
 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index 6bf77fd..d4a61b3 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -83,9 +83,7 @@  sim_open (kind, callback, abfd, argv)
      augment the meaning of an option.  */
   sim_add_option_table (sd, NULL, frv_options);
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/ft32/ChangeLog b/sim/ft32/ChangeLog
index 3a1accc..03235f5 100644
--- a/sim/ft32/ChangeLog
+++ b/sim/ft32/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index ec019b3..a2d59b0 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -807,9 +807,7 @@  sim_open (SIM_OPEN_KIND kind,
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index 6291ce8..1af2d8a 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* compile.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* config.in, configure: Regenerate.
 
 2016-01-02  Mike Frysinger  <vapier@gentoo.org>
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index ef6a853..394167a 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -4859,9 +4859,7 @@  sim_open (SIM_OPEN_KIND kind,
       return 0;
     }
 
-    /* getopt will print the error message so we just have to exit if
-       this fails.  FIXME: Hmmm...  in the case of gdb we need getopt
-       to call print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       /* Uninstall the modules to avoid memory leaks,
diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog
index 38d815a..68bb2fd 100644
--- a/sim/iq2000/ChangeLog
+++ b/sim/iq2000/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-if.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* iq2000-sim.h: Delete file.
 	* Makefile.in (SIM_EXTRA_DEPS): Delete iq2000-sim.h.
 	* sim-main.h: Delete iq2000-sim.h include.
diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c
index fefa764..f9ccf1f 100644
--- a/sim/iq2000/sim-if.c
+++ b/sim/iq2000/sim-if.c
@@ -82,9 +82,7 @@  sim_open (kind, callback, abfd, argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog
index 1729788..a25d28b 100644
--- a/sim/lm32/ChangeLog
+++ b/sim/lm32/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-if.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index 6786024..a135232 100644
--- a/sim/lm32/sim-if.c
+++ b/sim/lm32/sim-if.c
@@ -121,9 +121,7 @@  sim_open (kind, callback, abfd, argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index c4c9759..7723cb9 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-if.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* TODO: Delete file.
 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c
index 2777f61..435d8b6 100644
--- a/sim/m32r/sim-if.c
+++ b/sim/m32r/sim-if.c
@@ -84,9 +84,7 @@  sim_open (kind, callback, abfd, argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 0ee8235..fbf142b 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* sim-main.h (sim_state): Delete devices member.
 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index a51266b..25cea7c 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -445,9 +445,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *callback,
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       /* Uninstall the modules to avoid memory leaks,
diff --git a/sim/mcore/ChangeLog b/sim/mcore/ChangeLog
index 6b05983..05b9d45 100644
--- a/sim/mcore/ChangeLog
+++ b/sim/mcore/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index a591f61..d50ca16 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -1360,9 +1360,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog
index 71cb6b2..783048d 100644
--- a/sim/microblaze/ChangeLog
+++ b/sim/microblaze/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 2f85d37..86ae78c 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -404,9 +404,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 47dd1b0..f8ec3e7 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index 843ba94..0801ac1 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -376,9 +376,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
   sim_add_option_table (sd, NULL, mips_options);
 
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       /* Uninstall the modules to avoid memory leaks,
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index 8d23035..4311aa5 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index 8550c45..8959b40 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -125,9 +125,7 @@  sim_open (SIM_OPEN_KIND kind,
   sim_do_command (sd, "memory region 0,0x100000");
   sim_do_command (sd, "memory region 0x40000000,0x200000");
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       /* Uninstall the modules to avoid memory leaks,
diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog
index 84b89e8..18ad7b2 100644
--- a/sim/moxie/ChangeLog
+++ b/sim/moxie/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index 2807d19..bcc9ad5 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -1194,9 +1194,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index b3f8854..b9641d4 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* interp.c (count_argc): Delete.
 	(trap): Change count_argc to countargv.
 
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index f59ad00..2f59c5c 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -2406,9 +2406,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/sh64/ChangeLog b/sim/sh64/ChangeLog
index 8ccee76..0ca9814 100644
--- a/sim/sh64/ChangeLog
+++ b/sim/sh64/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* sim-if.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* sh64-sim.h (GETTWI, SETTWI): Delete unused defines.
 	(sh5_devices): Delete.
 	(struct _device): Delete.
diff --git a/sim/sh64/sim-if.c b/sim/sh64/sim-if.c
index ba8feb8..907ee06 100644
--- a/sim/sh64/sim-if.c
+++ b/sim/sh64/sim-if.c
@@ -79,9 +79,7 @@  sim_open (kind, callback, abfd, argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 49b97c1..96ae98a 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-01-03  Mike Frysinger  <vapier@gentoo.org>
 
+	* interp.c (sim_open): Update sim_parse_args comment.
+
+2016-01-03  Mike Frysinger  <vapier@gentoo.org>
+
 	* configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
 	* configure: Regenerate.
 
diff --git a/sim/v850/interp.c b/sim/v850/interp.c
index 422d926..ef91d51 100644
--- a/sim/v850/interp.c
+++ b/sim/v850/interp.c
@@ -234,9 +234,7 @@  sim_open (SIM_OPEN_KIND    kind,
   /* similarly if in the internal RAM region */
   sim_do_command (sd, "memory region 0xffe000,0x1000,1024");
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       /* Uninstall the modules to avoid memory leaks,