diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-09-09 03:01:28 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-09-09 03:01:28 -0400 |
commit | 21b9b99cd797fd2581ed559b89ec0c2cc6e87edf (patch) | |
tree | d65b1c51e596a198a92f8951dbd70c3246ae1267 /sim/common | |
parent | b728479074067064ed997a161d3b53feab3476f2 (diff) | |
download | gdb-21b9b99cd797fd2581ed559b89ec0c2cc6e87edf.zip gdb-21b9b99cd797fd2581ed559b89ec0c2cc6e87edf.tar.gz gdb-21b9b99cd797fd2581ed559b89ec0c2cc6e87edf.tar.bz2 |
sim: accept -EB/-EL short options
Many GNU tools accept -EB/-EL as short options for selecting big &
little endian modes. While the sim has an -E option, it requires
spelling out "big" and "little". Adding support for -EB & -EL is
thus quite trivial, so lets round it out to be less annoying.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/sim-options.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 06bd582..9915c22 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -113,7 +113,7 @@ static const OPTION standard_options[] = standard_option_handler, NULL }, { {"endian", required_argument, NULL, OPTION_ENDIAN}, - 'E', "big|little", "Set endianness", + 'E', "B|big|L|little", "Set endianness", standard_option_handler, NULL }, /* This option isn't supported unless all choices are supported in keeping @@ -190,7 +190,7 @@ standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt, break; case OPTION_ENDIAN: - if (strcmp (arg, "big") == 0) + if (strcmp (arg, "big") == 0 || strcmp (arg, "B") == 0) { if (WITH_TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE) { @@ -200,7 +200,7 @@ standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt, /* FIXME:wip: Need to set something in STATE_CONFIG. */ current_target_byte_order = BFD_ENDIAN_BIG; } - else if (strcmp (arg, "little") == 0) + else if (strcmp (arg, "little") == 0 || strcmp (arg, "L") == 0) { if (WITH_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { |