aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-options.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-27 00:35:34 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-27 00:35:34 +0000
commitd07dddd2b24abd93f92412a6764129f29c1acc0e (patch)
tree57ac972e0d0749cdc10b8c1503a61ab46c1cb1db /sim/common/sim-options.c
parent099ddbf11783723ba9dd45adb9ce928c299539f0 (diff)
downloadgdb-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.c13
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");