From 77cf2ef5dc9099501529151921a73be904757466 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 3 Jan 2016 21:40:34 -0500 Subject: [PATCH] sim: parse_args: display getopt error ourselves 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 --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index e9346c1732..2e846efb64 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * wrapper.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * wrapper.c (sim_target_parse_arg_array): Replace for loop with diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 274b294ecf..9e61ed6cfc 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 71075540e2..27d1e27160 100644 --- a/sim/avr/ChangeLog +++ b/sim/avr/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/avr/interp.c b/sim/avr/interp.c index 91b97928b8..f33de1cfa7 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 1bbef04286..67612b2788 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * TODO: Delete file. diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index 84fb0856c4..ad865005ea 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 d358491761..9de52381b5 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +2016-01-03 Mike Frysinger + + * 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 * hw-device.h (device): Delete commented typedef. diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 88663f7030..f662b734cf 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 1e4e737cce..dc56bb4569 100644 --- a/sim/cr16/ChangeLog +++ b/sim/cr16/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index a0e30f5555..9aa2062a99 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 6474681070..7f8ea85cf8 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * sim-if.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * sim-main.h (cris_devices): Delete. diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index ac4ab45824..3b0b546677 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 e745678ff5..5c647bf08f 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 807c5c21a0..a49cd528be 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 7a6b86a2da..0be8512084 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * sim-if.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * TODO: Delete file. diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c index 6bf77fde0a..d4a61b337a 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 3a1acccf85..03235f5813 100644 --- a/sim/ft32/ChangeLog +++ b/sim/ft32/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c index ec019b3094..a2d59b0784 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 6291ce8eb2..1af2d8ab99 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * compile.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * config.in, configure: Regenerate. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index ef6a853a11..394167a601 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 38d815a89e..68bb2fd9de 100644 --- a/sim/iq2000/ChangeLog +++ b/sim/iq2000/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * sim-if.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * iq2000-sim.h: Delete file. diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c index fefa764dde..f9ccf1f218 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 1729788428..a25d28be09 100644 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * sim-if.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c index 678602449a..a135232f65 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 c4c9759c60..7723cb91e3 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * sim-if.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * TODO: Delete file. diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c index 2777f6192f..435d8b6bda 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 0ee8235ef9..fbf142b1a2 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * sim-main.h (sim_state): Delete devices member. diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c index a51266b91b..25cea7c3d5 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 6b05983a8e..05b9d459c9 100644 --- a/sim/mcore/ChangeLog +++ b/sim/mcore/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c index a591f61680..d50ca16a19 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 71cb6b287b..783048da91 100644 --- a/sim/microblaze/ChangeLog +++ b/sim/microblaze/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c index 2f85d37822..86ae78c5b1 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 47dd1b0f4b..f8ec3e7a40 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/mips/interp.c b/sim/mips/interp.c index 843ba94105..0801ac17fd 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 8d230352e9..4311aa501e 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 8550c4544d..8959b40ff2 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 84b89e8124..18ad7b20a9 100644 --- a/sim/moxie/ChangeLog +++ b/sim/moxie/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index 2807d19cd6..bcc9ad5d9c 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 b3f885481a..b9641d4312 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * interp.c (count_argc): Delete. diff --git a/sim/sh/interp.c b/sim/sh/interp.c index f59ad00b5d..2f59c5c92c 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 8ccee765fe..0ca9814a22 100644 --- a/sim/sh64/ChangeLog +++ b/sim/sh64/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * sim-if.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * sh64-sim.h (GETTWI, SETTWI): Delete unused defines. diff --git a/sim/sh64/sim-if.c b/sim/sh64/sim-if.c index ba8feb8123..907ee06a25 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 49b97c14a9..96ae98a922 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,7 @@ +2016-01-03 Mike Frysinger + + * interp.c (sim_open): Update sim_parse_args comment. + 2016-01-03 Mike Frysinger * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete. diff --git a/sim/v850/interp.c b/sim/v850/interp.c index 422d926b2d..ef91d510e2 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, -- 2.34.1