]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: parse_args: display getopt error ourselves
authorMike Frysinger <vapier@gentoo.org>
Mon, 4 Jan 2016 02:40:34 +0000 (21:40 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 4 Jan 2016 03:07:39 +0000 (22:07 -0500)
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.

44 files changed:
sim/arm/ChangeLog
sim/arm/wrapper.c
sim/avr/ChangeLog
sim/avr/interp.c
sim/bfin/ChangeLog
sim/bfin/interp.c
sim/common/ChangeLog
sim/common/sim-options.c
sim/cr16/ChangeLog
sim/cr16/interp.c
sim/cris/ChangeLog
sim/cris/sim-if.c
sim/d10v/ChangeLog
sim/d10v/interp.c
sim/frv/ChangeLog
sim/frv/sim-if.c
sim/ft32/ChangeLog
sim/ft32/interp.c
sim/h8300/ChangeLog
sim/h8300/compile.c
sim/iq2000/ChangeLog
sim/iq2000/sim-if.c
sim/lm32/ChangeLog
sim/lm32/sim-if.c
sim/m32r/ChangeLog
sim/m32r/sim-if.c
sim/m68hc11/ChangeLog
sim/m68hc11/interp.c
sim/mcore/ChangeLog
sim/mcore/interp.c
sim/microblaze/ChangeLog
sim/microblaze/interp.c
sim/mips/ChangeLog
sim/mips/interp.c
sim/mn10300/ChangeLog
sim/mn10300/interp.c
sim/moxie/ChangeLog
sim/moxie/interp.c
sim/sh/ChangeLog
sim/sh/interp.c
sim/sh64/ChangeLog
sim/sh64/sim-if.c
sim/v850/ChangeLog
sim/v850/interp.c

index e9346c17321f39f715b880f4dd6cec5b1d89ad95..2e846efb64d4bd3d40e4902f094d6632e254a908 100644 (file)
@@ -1,3 +1,7 @@
+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
index 274b294ecf780252c7441796fb32a72b6c6354c5..9e61ed6cfc656ad19dc816a9cf667ed3c12226c5 100644 (file)
@@ -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);
index 71075540e2f3737c140851dd0faf23b5df76665c..27d1e271608da508f555109ddd22cbc4497ea3ac 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 91b97928b8306bf3abb8fba96c2d3d2c16376e1f..f33de1cfa70dd498b4f722334fc277ed0e37449a 100644 (file)
@@ -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);
index 1bbef042863add5deb827048e91d7b0155d7a42b..67612b27885e3d30b2d8707ed0356df8522614e0 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 84fb0856c44c94e6254639657bf14f331d91bf89..ad865005ea4d3b129f8f2c9fe57d513b24b4cbc4 100644 (file)
@@ -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);
index d35849176178f7c55c1be8ef498fb44aec7517ec..9de52381b5a93fa4a4dde5bfe8dde9b5cc844e2a 100644 (file)
@@ -1,3 +1,9 @@
+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.
index 88663f7030e67bd43b3fe7284e91f6f9e0685e6d..f662b734cfb8dd5775968aee71f1a8ec048a9a08 100644 (file)
@@ -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);
index 1e4e737ccea5a28f6e474a971c1b885a5f16e582..dc56bb4569f0b8adbb77a0c3535f6c6b063177e4 100644 (file)
@@ -1,3 +1,7 @@
+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.
index a0e30f5555fea41dfeef723eb7d53f3f12aaa83a..9aa2062a99e7fc4027f349f7d12cf661fd86cd57 100644 (file)
@@ -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);
index 6474681070ebabe07075b451c2f2a9a0d493e7f5..7f8ea85cf8c441c4cfabb24d9cbe8725ee035759 100644 (file)
@@ -1,3 +1,7 @@
+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.
index ac4ab45824029413c487d6f80d27889abe87f66b..3b0b5466779d58035e8ee8044fea2c43d8dcf182 100644 (file)
@@ -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);
index e745678ff56769b06838c2512a9e22424f0c7536..5c647bf08f407f7c8cfd4115ac15d3017513823d 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 807c5c21a0874059b43abf2239d6bc5a3109b5b1..a49cd528be44fb29d9e3b6224e2ad882f7d5cdfb 100644 (file)
@@ -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);
index 7a6b86a2daa240f99c2c659aab3218b717ac0f3b..0be8512084d592e058a7014d732c954f3be18b07 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 6bf77fde0aed831249caabaf2961d31e00c44d25..d4a61b337a03e05955346f5ebf3f4909c791959b 100644 (file)
@@ -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);
index 3a1acccf85fbe1fc563cd56d4e3d9caac610eaa7..03235f58131698fa7c42ab069e42e760ecba7cb0 100644 (file)
@@ -1,3 +1,7 @@
+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.
index ec019b30948b7f370ee92a5ce0f04429a08d8d29..a2d59b0784b7266417bbf5cc1103dce7e201099a 100644 (file)
@@ -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);
index 6291ce8eb24ae0001ba6e47d9156487a539f8dc7..1af2d8ab9972cfc036b51c203e5af1f817857c72 100644 (file)
@@ -1,3 +1,7 @@
+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.
index ef6a853a11976777a327382b627f8d014b3ee631..394167a601fafe719d0855096fc3c596521fa827 100644 (file)
@@ -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,
index 38d815a89e76527182ca613e55aed7c0c587011c..68bb2fd9dee5f05fb97b0eceeb3122ccd898c7fd 100644 (file)
@@ -1,3 +1,7 @@
+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.
index fefa764dde06c5936b1955edb07260e2848bae60..f9ccf1f218697f4e1dda3e707e27f51b7e793e02 100644 (file)
@@ -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);
index 17297884282f605957119d0507126bd63f385e82..a25d28be097cc259751c1a1b469d4b10462ca5b5 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 678602449a1a365cd6c7afa0f80382321bfd7d4e..a135232f65f6b792b027594c4de12cc90cc52bf3 100644 (file)
@@ -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);
index c4c9759c601cae78733479b74addd259ddb816bb..7723cb91e3f29a5c2584d48139852b12dc26ff8a 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 2777f6192f74d59e652cf08b51e11bb01e38acfb..435d8b6bda1a342ea1a8717add2309d0d0b0a045 100644 (file)
@@ -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);
index 0ee8235ef92db33f4d4a4a7d3ed7de4b7b5d5e80..fbf142b1a21f2f394d6f64317693b0da1bdd06e2 100644 (file)
@@ -1,3 +1,7 @@
+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.
index a51266b91b1fe4b0ddb5b3b0da403179c21b8cf8..25cea7c3d5f8dbf25fa9699edf29ee92e5f5344a 100644 (file)
@@ -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,
index 6b05983a8e473a4999f4dc8245b769c885c64fb5..05b9d459c9b04515dc201d42d5d1e1c09c7b0ce7 100644 (file)
@@ -1,3 +1,7 @@
+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.
index a591f61680391c1763cc85a8be3cde82c3ee1dc6..d50ca16a195fd1458ecef076858b9c4f9728bec8 100644 (file)
@@ -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);
index 71cb6b287b5d3d7f057eb4bcb57ab262e677842f..783048da918049f8f3f9bed72e9603483deefdd5 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 2f85d37822371370bb1782efd120a730820cc7b7..86ae78c5b1a3a69f248ed0de2fa06bce51de059c 100644 (file)
@@ -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);
index 47dd1b0f4bdc92b18d0ddd66d4b6e4afe7b2e898..f8ec3e7a40259ba318c31e9e7eac13b4ebd79e4e 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 843ba94105e8153175ff78c5b81464b345661fa8..0801ac17fd4967a9b293dc6132b210b3d39fc10f 100644 (file)
@@ -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,
index 8d230352e973974a2992ba125512881ff846c318..4311aa501e5e50e5c46dac7696be39739d7b1d56 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 8550c4544d8bc3b58d4bb8e11e807cfda1aa3535..8959b40ff2c956917571a640fb39e01245c15745 100644 (file)
@@ -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,
index 84b89e81244bf9f37d06fa729b2086d638495e34..18ad7b20a9872fc2f4a991cbd0b93a90ad645ed1 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 2807d19cd6aedb02c7030540b2cfc97e80a6039f..bcc9ad5d9c45daf6332c8f8ae996a2a45263896d 100644 (file)
@@ -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);
index b3f885481aed2bff4b070349e1fbbba638cfa9f3..b9641d43125e460868728e98d8775e16f287fe75 100644 (file)
@@ -1,3 +1,7 @@
+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.
index f59ad00b5d54b493119a1bea08d1c5496be3c336..2f59c5c92c9f29ee5841bd012fbcaac6023f9db0 100644 (file)
@@ -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);
index 8ccee765fe1e72eb8dbfa4c532e4c66b225c4c6d..0ca9814a220162724ec6504f0ad18613f4dfd828 100644 (file)
@@ -1,3 +1,7 @@
+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.
index ba8feb81237de7a2a4144bffaf5f2736a72bd6f5..907ee06a25cb901906609ab5b48b57f4a78ffdae 100644 (file)
@@ -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);
index 49b97c14a9889a02692a09f2b716a7a0d3340e60..96ae98a9222fdc459d6f4de91ba339e5c57bc32b 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 422d926b2db63ffc8f36c1d241342bdc16c2a29d..ef91d510e253d633fc80e57af8d339a60f8adbc3 100644 (file)
@@ -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,