diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-08-27 00:35:34 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-08-27 00:35:34 +0000 |
commit | d07dddd2b24abd93f92412a6764129f29c1acc0e (patch) | |
tree | 57ac972e0d0749cdc10b8c1503a61ab46c1cb1db /sim/common/sim-options.c | |
parent | 099ddbf11783723ba9dd45adb9ce928c299539f0 (diff) | |
download | gdb-d07dddd2b24abd93f92412a6764129f29c1acc0e.zip gdb-d07dddd2b24abd93f92412a6764129f29c1acc0e.tar.gz gdb-d07dddd2b24abd93f92412a6764129f29c1acc0e.tar.bz2 |
Save a copy of argv, not just a pointer.
Diffstat (limited to 'sim/common/sim-options.c')
-rw-r--r-- | sim/common/sim-options.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 7a8dbe7..8ed5f63 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -375,7 +375,7 @@ sim_parse_args (sd, argv) if (optc == -1) { if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE) - STATE_PROG_ARGV (sd) = argv + optind; + STATE_PROG_ARGV (sd) = sim_copy_argv (argv + optind); break; } if (optc == '?') @@ -405,7 +405,11 @@ sim_print_help (sd, is_command) /* Initialize duplicate argument checker. */ (void) dup_arg_p (NULL); - sim_io_printf (sd, "Options:\n"); + if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE) + sim_io_printf (sd, "Options:\n"); + else + sim_io_printf (sd, "Commands:\n"); + for (ol = STATE_OPTIONS (sd); ol != NULL; ol = ol->next) for (opt = ol->options; opt->opt.name != NULL; ++opt) { @@ -503,6 +507,11 @@ sim_print_help (sd, is_command) sim_io_printf (sd, "%s\n", opt->doc); } + sim_io_printf (sd, "\n"); + sim_io_printf (sd, "Note: Depending on the simulator configuration some %ss\n", + STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE ? "option" : "command"); + sim_io_printf (sd, " may not be applicable\n"); + if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE) { sim_io_printf (sd, "\n"); |