diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-05-27 06:48:20 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-05-27 06:48:20 +0000 |
commit | 2f2e6c5d5bf76a01caa0d2da27ac21e45ee2276e (patch) | |
tree | e423d11adc8c988ab292d78c6e7a592064ac5ead /sim/common/sim-options.c | |
parent | d82e4bf6cc9f6dfb853b2c9fa138b3640381fdf6 (diff) | |
download | gdb-2f2e6c5d5bf76a01caa0d2da27ac21e45ee2276e.zip gdb-2f2e6c5d5bf76a01caa0d2da27ac21e45ee2276e.tar.gz gdb-2f2e6c5d5bf76a01caa0d2da27ac21e45ee2276e.tar.bz2 |
Extend xor-endian and per-cpu support in core module.
Allow negated test when watching value within core.
Diffstat (limited to 'sim/common/sim-options.c')
-rw-r--r-- | sim/common/sim-options.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 4f8890b..7a8dbe7 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -239,7 +239,7 @@ standard_option_handler (sd, opt, arg, is_command) break; case 'H': - sim_print_help (sd); + sim_print_help (sd, is_command); if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE) exit (0); /* FIXME: 'twould be nice to do something similar if gdb. */ @@ -391,8 +391,9 @@ sim_parse_args (sd, argv) /* Print help messages for the options. */ void -sim_print_help (sd) +sim_print_help (sd, is_command) SIM_DESC sd; + int is_command; { const struct option_list *ol; const OPTION *opt; @@ -425,32 +426,35 @@ sim_print_help (sd) comma = 0; len = 2; - o = opt; - do + if (!is_command) { - if (o->shortopt != '\0') + o = opt; + do { - sim_io_printf (sd, "%s-%c", comma ? ", " : "", o->shortopt); - len += (comma ? 2 : 0) + 2; - if (o->arg != NULL) + if (o->shortopt != '\0') { - if (o->opt.has_arg == optional_argument) - { - sim_io_printf (sd, "[%s]", o->arg); - len += 1 + strlen (o->arg) + 1; - } - else + sim_io_printf (sd, "%s-%c", comma ? ", " : "", o->shortopt); + len += (comma ? 2 : 0) + 2; + if (o->arg != NULL) { - sim_io_printf (sd, " %s", o->arg); - len += 1 + strlen (o->arg); + if (o->opt.has_arg == optional_argument) + { + sim_io_printf (sd, "[%s]", o->arg); + len += 1 + strlen (o->arg) + 1; + } + else + { + sim_io_printf (sd, " %s", o->arg); + len += 1 + strlen (o->arg); + } } + comma = 1; } - comma = 1; + ++o; } - ++o; + while (o->opt.name != NULL && o->doc == NULL); } - while (o->opt.name != NULL && o->doc == NULL); - + o = opt; do { @@ -461,11 +465,12 @@ sim_print_help (sd) name = o->opt.name; if (name != NULL) { - sim_io_printf (sd, "%s--%s", + sim_io_printf (sd, "%s%s%s", comma ? ", " : "", + is_command ? "" : "--", name); len += ((comma ? 2 : 0) - + 2 + + (is_command ? 0 : 2) + strlen (name)); if (o->arg != NULL) { |