aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-options.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-04sim: parse_args: polish getopt error messageMike Frysinger1-1/+1
The cris sim hit a few failures after the recent getopt logic, and the expected output showed a few ways we can improve things to better match other utils.
2016-01-03sim: parse_args: display getopt error ourselvesMike Frysinger1-1/+27
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.
2016-01-03sim: use libiberty countargv in more placesMike Frysinger1-2/+1
A bunch of places open code the countargv implementation, or outright duplicate it (as count_argc). Replace all of those w/countargv.
2016-01-03sim: convert to bfd_endianMike Frysinger1-4/+4
Rather than re-invent endian defines, as well as maintain our own list of OS & arch-specific includes, punt all that logic in favor of the bfd ones already set up and maintained elsewhere. We already rely on the bfd library, so leveraging the endian aspect should be fine.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-12-24sim: make LMA loading the default for all targetsMike Frysinger1-9/+1
Most targets already default to loading code via their LMA, but for a few, this means the default changes from loading VMA to LMA. It's better to have the different targets be consistent, and allows some code clean up.
2015-12-24sim: h8300: move h8300-specific options out of common codeMike Frysinger1-29/+0
Register the options in sim_open like other arches to avoid having to hack up the common modules.
2015-12-24sim: delete SIM_HAVE_FLATMEM supportMike Frysinger1-38/+0
No target has used this, and it's a cheap hack in place in using the common memory module. We want everyone using that though, so drop support for flatmem entirely.
2015-04-13sim: options: add --version supportMike Frysinger1-0/+11
The old run frontend had a --version option, but the new common sim-options file does not. Restore support for that so we can get version info out of `run` when using the new frontend.
2015-02-03sim: Call freeargv() when failure occursChen Gang1-1/+4
After successfully call buildargv(), the code need to be sure of calling freeargv() in any cases. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * common/sim-options.c (sim_args_command): Call freeargv() when failure occurs.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-03-10sim: constify arg to sim_do_commandMike Frysinger1-1/+1
It is rare for people to want to modify the cmd arg. In general, they really shouldn't be, but a few still do. For those who misbehave, dupe the string locally so they can bang on it.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-09-03sim: mark complete_option_list args const to fix build warningsMike Frysinger1-1/+1
The completion API was updated, but this func missed having its text/word args const.
2013-03-15gdb:Steve Ellcey1-1/+1
2013-03-15 Steve Ellcey <sellcey@mips.com> * remote-sim.c (sim_command_completer): Make char arguments const. include: 2013-03-15 Steve Ellcey <sellcey@mips.com> * gdb/remote-sim.h (sim_command_completer): Make char arguments const. sim: 2013-03-15 Steve Ellcey <sellcey@mips.com> * arm/wrapper.c (sim_complete_command): Make char arguments const. * avr/interp.c (sim_complete_command): Ditto. * common/sim-options.c (sim_complete_command): Ditto. * cr16/interp.c (sim_complete_command): Ditto. * erc32/interf.c (sim_complete_command): Ditto. * m32c/gdb-if.c (sim_complete_command): Ditto. * microblaze/interp.c (sim_complete_command): Ditto. * ppc/sim_calls.c (sim_complete_command): Ditto. * rl78/gdb-if.c (sim_complete_command): Ditto. * rx/gdb-if.c (sim_complete_command): Ditto. * sh/interp.c (sim_complete_command): Ditto.
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-2/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-2/+2
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-05-27sim: fix minor --sysroot mem leakMike Frysinger1-3/+7
The current --sysroot parsing attempts to keep from leaking memory by treating the empty string specially (sine this is the initial value), but it ends up leaking memory when the arg is an empty string. So if someone uses --sysroot "", the old value is leaked, as is the new one. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-11sim: fix func call style (space before paren)Mike Frysinger1-1/+1
Committed this as obvious: -foo(...); +foo (...); Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-15gdb: sim: add style fixes lost between git->cvsMike Frysinger1-0/+1
2011-04-15gdb: sim: add command line completionMike Frysinger1-0/+51
For now, only the sub-command name is completed. No support yet for completing options to that command. But even this is a huge step as currently, nothing is completed, and the basic "help sim" is fairly obtuse as to what exactly the "sim" command accepts. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-15sim: common: trim trailing whitespaceMike Frysinger1-5/+5
2011-02-14sim: punt zfree()Mike Frysinger1-5/+5
The sim keeps track of which allocations are zero-ed internally (via zalloc) and then calls a helper "zfree" function rather than "free". But this "zfree" function simply calls "free" itself. Since I can see no point in this and it is simply useless overhead, punt it. The only real change is in hw-alloc.c where we remove the zalloc_p tracking, and sim-utils.c where zfree is delete. The rest of the changes are a simple `sed` from "zfree" to "free". Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-12sim: check asprintf return valuesMike Frysinger1-1/+6
These are the last sources of build warnings (asprintf usage) that I see. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-04-12sim: add missing values to array initializersMike Frysinger1-4/+4
The sim code has a lot of static initializer for options and devices, but since they aren't using newer struct style, they have to specify a value for every option otherwise gcc spits a lot of warnings about "missing initializer". So add NULL/0 stubs for pointers/values. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-12sim: constify dup_arg_pMike Frysinger1-3/+3
The dup_arg_p function is only given const strings, and it maintains a local table of those const strings. So constify the whole thing to fix the GCC warnings: common/sim-options.c: In function 'sim_parse_args': common/sim-options.c:559: warning: passing argument 1 of 'dup_arg_p' discards qualifiers from pointer target type common/sim-options.c: In function 'print_help': common/sim-options.c:675: warning: passing argument 1 of 'dup_arg_p' discards qualifiers from pointer target type Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-10sim: add const markings to env stringMike Frysinger1-1/+1
The sim-options code assigns a const string to "char *" in decoding the current environment settings, and only uses it to pass to a printf. GCC outputs the warnings: common/sim-options.c: In function 'standard_option_handler': common/sim-options.c:271: warning: assignment discards qualifiers from pointer target type common/sim-options.c:272: warning: assignment discards qualifiers from pointer target type common/sim-options.c:273: warning: assignment discards qualifiers from pointer target type So I've committed this as "obvious". Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-03-30sim: convert old style function definitionsMike Frysinger1-8/+3
GCC currently emits warnings like: nrun.c: In function 'usage': nrun.c:223: warning: old-style function definition
2010-03-22sim: always enable support for the --endian optionMike Frysinger1-6/+0
The gdb code always passes down -E <little|big> to the sim core when using the sim target. But the sim core only recognizes this option when the sim supports big endian systems. So for little endian simulators, any attempt to use the sim target fails with: (gdb) target sim gdbsim: invalid option -- 'E' unable to create simulator instance Since always respecting the option doesn't cause any problems, do just that. If someone tries to use an invalid endian, they'll get an error anyways.
2010-01-01Update copyright notices to add year 2010.Joel Brobecker1-1/+1
2009-01-14 Update the copyright notice of some of the files I missedJoel Brobecker1-1/+2
in the previous copyright update.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-08-24 Switch the license of all files explicitly copyright the FSFJoel Brobecker1-5/+4
to GPLv3.
2007-08-10* sim-memopt.c (memory_options): Mention that the memory-size switch accepts ↵Nick Clifton1-3/+17
suffixes. (parse_size): Handle a suffix on the size value. * sim-options.c (standard_options): Mention that the mem-size switch accepts suffixes. (standard_option_handler): Handle a suffix on the size value.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2004-12-08 * run.1: Document --sysroot=filepath.Hans-Peter Nilsson1-1/+15
* sim-options.c (STANDARD_OPTIONS): New member OPTION_SYSROOT. (standard_options): Support --sysroot=<path>. (standard_option_handler): Handle OPTION_SYSROOT. * syscall.c (simulator_sysroot): Define, initialized empty. (get_path): Prepend simulator_sysroot to absolute file path. [HAVE_STRING_H]: Include string.h. [!HAVE_STRING_H && HAVE_STRINGS_H]: Include strings.h. * nrun.c [HAVE_UNISTD_H]: Include unistd.h. (main): If simulator_sysroot is not empty, chdir there. * sim-config.h (simulator_sysroot): Declare.
2004-07-10 * hw-tree.c (parse_integer_property): Typo fix in comments.Ben Elliston1-2/+2
* sim-options.c (sim_args_command): Likewise.
2003-11-22 * sim-options.c (standard_options): Fix the names of H8Kazu Hirata1-3/+3
variants.
2003-08-28Index: common/ChangeLogAndrew Cagney1-1/+4
2003-08-28 Andrew Cagney <cagney@redhat.com> * dv-glue.c (hw_glue_finish): Change %d to %ld to match sizeof. * sim-options.c (print_help): Cast the format with specifier to "int". Index: mn10300/ChangeLog 2003-08-28 Andrew Cagney <cagney@redhat.com> * dv-mn103ser.c (do_polling_event): Change type of "serial_reg" to "long". (read_status_reg): Cast "serial_reg" to "long". * dv-mn103tim.c (do_counter_event): Change type of "timer_nr" to "long". (do_counter6_event, write_mode_reg, write_tm6md): Ditto.
2003-06-052003-06-04 Michael Snyder <msnyder@redhat.com>Michael Snyder1-5/+12
* common/run.c (main): Remove SIM_H8300 ifdef. (usage): Ditto. * common/sim-options.c (STANDARD_OPTIONS): Add SIM_H8300SX. (standard_options): Add '-x' for h8/300sx. (standard_option_handler): Add case for SIM_H8300SX.
2002-05-17* h8300s now new target, not alias of h8300hAndrey Volkov1-2/+9
2000-11-25Fix memory leak in sim_parse_argsStephane Carrez1-4/+17
1999-12-14import gdb-1999-12-13 snapshotJason Molenda1-1/+1
1999-07-12import gdb-1999-07-12 snapshotJason Molenda1-0/+30
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+936
1999-04-16Initial creation of sourceware repositoryStan Shebs1-936/+0
1998-03-01(find_match): recheck argv[argi] in multi-word match. Fixes crash whenRon Unrau1-1/+2
subset words are alone on the command line.
1998-02-28Pacify GCC: const char * passed to asprintf; int function returningAndrew Cagney1-3/+4
void; unused variable.
1998-02-27 * sim-base.h (sim_cpu_base): New members name, options.Doug Evans1-79/+216
(sim_cpu_lookup): Add prototype. * sim-module.c (sim_pre_argv_init): Provide default names for cpus. * sim-options.h (DECLARE_OPTION_HANDLER): New argument `cpu'. (sim_add_option_table): Update prototype. * sim-options.c (sim_add_option_table): New argument `cpu'. (standard_option_handler,standard_install): Update. (sim_parse_args): Handle cpu specific options. (print_help): New static function. (sim_print_help): Call it. Print cpu specific options. (find_match): New static function. (sim_args_command): Call it. Handle cpu specific options. * sim-utils.c (sim_cpu_lookup): New function. * sim-memopt.c (memory_option_handler): Update. (sim_memopt_install): Update. * sim-model.c (model_option_handler): Update. (model_install): Update. * sim-profile.c (profile_option_handler): Update. (profile_install): Update. * sim-trace.c (trace_option_handler): Update. (trace_install): Update. * sim-watch.c (watchpoint_option_handler): Update. (sim_watchpoint_install): Update. * cgen-scache.c (scache_option_handler): Update. (scache_install): Update.