From 2e3d4f4d5d386995e99d035354a9e411d1dc0331 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 3 Jan 2016 01:51:44 -0500 Subject: [PATCH] sim: sim_{create_inferior,open,parse_args}: constify argv/env slightly 2016-01-03 Mike Frysinger * sim-options.c (sim_parse_args): Mark argv array const. * sim-options.h (sim_parse_args): Likewise. --- include/gdb/ChangeLog | 5 +++++ include/gdb/remote-sim.h | 6 ++++-- sim/aarch64/ChangeLog | 5 +++++ sim/aarch64/interp.c | 5 +++-- sim/arm/ChangeLog | 5 +++++ sim/arm/wrapper.c | 6 +++--- sim/avr/ChangeLog | 5 +++++ sim/avr/interp.c | 6 ++++-- sim/bfin/ChangeLog | 10 ++++++++++ sim/bfin/interp.c | 16 ++++++++-------- sim/common/ChangeLog | 5 +++++ sim/common/sim-options.c | 2 +- sim/common/sim-options.h | 2 +- sim/cr16/ChangeLog | 5 +++++ sim/cr16/interp.c | 6 ++++-- sim/cris/ChangeLog | 5 +++++ sim/cris/sim-if.c | 6 +++--- sim/d10v/ChangeLog | 5 +++++ sim/d10v/interp.c | 6 ++++-- sim/erc32/ChangeLog | 5 +++++ sim/erc32/interf.c | 6 +++--- sim/frv/ChangeLog | 5 +++++ sim/frv/sim-if.c | 6 +++--- sim/ft32/ChangeLog | 5 +++++ sim/ft32/interp.c | 6 +++--- sim/h8300/ChangeLog | 5 +++++ sim/h8300/compile.c | 5 +++-- sim/iq2000/ChangeLog | 5 +++++ sim/iq2000/sim-if.c | 6 +++--- sim/lm32/ChangeLog | 5 +++++ sim/lm32/sim-if.c | 6 +++--- sim/m32c/ChangeLog | 5 +++++ sim/m32c/gdb-if.c | 5 +++-- sim/m32r/ChangeLog | 5 +++++ sim/m32r/sim-if.c | 6 +++--- sim/m68hc11/ChangeLog | 5 +++++ sim/m68hc11/interp.c | 4 ++-- sim/mcore/ChangeLog | 5 +++++ sim/mcore/interp.c | 6 ++++-- sim/microblaze/ChangeLog | 5 +++++ sim/microblaze/interp.c | 6 ++++-- sim/mips/ChangeLog | 5 +++++ sim/mips/interp.c | 6 ++++-- sim/mn10300/ChangeLog | 5 +++++ sim/mn10300/interp.c | 6 +++--- sim/moxie/ChangeLog | 5 +++++ sim/moxie/interp.c | 6 ++++-- sim/msp430/ChangeLog | 5 +++++ sim/msp430/msp430-sim.c | 6 +++--- sim/ppc/ChangeLog | 5 +++++ sim/ppc/sim_calls.c | 6 +++--- sim/rl78/ChangeLog | 5 +++++ sim/rl78/gdb-if.c | 5 +++-- sim/rx/ChangeLog | 5 +++++ sim/rx/gdb-if.c | 5 +++-- sim/sh/ChangeLog | 5 +++++ sim/sh/interp.c | 6 ++++-- sim/sh64/ChangeLog | 5 +++++ sim/sh64/sim-if.c | 6 +++--- sim/v850/ChangeLog | 5 +++++ sim/v850/interp.c | 6 +++--- 61 files changed, 257 insertions(+), 79 deletions(-) diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index b73c8ea1a6c..f05ba4b6287 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * remote-sim.h (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2015-11-24 Nick Clifton * sim-aarch64.h: New file. diff --git a/include/gdb/remote-sim.h b/include/gdb/remote-sim.h index 372e59bad7f..fc128982eb1 100644 --- a/include/gdb/remote-sim.h +++ b/include/gdb/remote-sim.h @@ -104,7 +104,8 @@ struct host_callback_struct; sim_create_inferior. FIXME: What should the state of the simulator be? */ -SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, char **argv); +SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, + struct bfd *abfd, char * const *argv); /* Destory a simulator instance. @@ -161,7 +162,8 @@ SIM_RC sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty); address space (according to the applicable ABI) and the program counter and stack pointer set accordingly. */ -SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env); +SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env); /* Fetch LENGTH bytes of the simulated program's memory. Start fetch diff --git a/sim/aarch64/ChangeLog b/sim/aarch64/ChangeLog index 2097fdb1753..c2224b13e1d 100644 --- a/sim/aarch64/ChangeLog +++ b/sim/aarch64/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_create_inferior): Mark argv and env const. + (sim_open): Mark argv const. + 2016-01-05 Mike Frysinger * interp.c: Delete dis-asm.h include. diff --git a/sim/aarch64/interp.c b/sim/aarch64/interp.c index 7dc0a2be538..8ae78c43a2b 100644 --- a/sim/aarch64/interp.c +++ b/sim/aarch64/interp.c @@ -131,7 +131,8 @@ aarch64_get_sym_value (const char *name) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { sim_cpu *cpu = STATE_CPU (sd, 0); long storage; @@ -329,7 +330,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct * callback, struct bfd * abfd, - char ** argv) + char * const * argv) { int i; sim_cpu *cpu; diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 8b83ef3eb0c..e769f639e38 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * wrapper.c (sim_create_inferior): Mark argv and env const. + (sim_open): Mark argv const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 9e61ed6cfc6..941a8fd91c5 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -229,8 +229,8 @@ sim_resume (SIM_DESC sd ATTRIBUTE_UNUSED, SIM_RC sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED, struct bfd * abfd, - char ** argv, - char ** env) + char * const *argv, + char * const *env) { int argvlen = 0; int mach; @@ -800,7 +800,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, - char **argv) + char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); diff --git a/sim/avr/ChangeLog b/sim/avr/ChangeLog index 3398eb13dbc..3d5b7231e8e 100644 --- a/sim/avr/ChangeLog +++ b/sim/avr/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/avr/interp.c b/sim/avr/interp.c index f33de1cfa70..31a99407bd2 100644 --- a/sim/avr/interp.c +++ b/sim/avr/interp.c @@ -1678,7 +1678,8 @@ free_state (SIM_DESC sd) } SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -1756,7 +1757,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { SIM_CPU *cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index 4f1f93debc4..62f70e3b7ea 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,13 @@ +2016-01-06 Mike Frysinger + + * interp.c (bfin_syscall): Remove first const from argv. + (sim_open): Mark argv const. + (simple_env): Remove first const. + (bfin_user_init): Remove first const from argv and and env + (bfin_os_init): Remove first const from argv. + (sim_create_inferior): Mark argv and env const. + Drop casts from bfin_user_init and bfin_os_init calls. + 2016-01-05 Mike Frysinger * interp.c (step_once): Call TRACE_DISASM. diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index ccd6a8a8c79..0875b510a60 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -119,7 +119,7 @@ void bfin_syscall (SIM_CPU *cpu) { SIM_DESC sd = CPU_STATE (cpu); - const char * const *argv = (void *)STATE_PROG_ARGV (sd); + char * const *argv = (void *)STATE_PROG_ARGV (sd); host_callback *cb = STATE_CALLBACK (sd); bu32 args[6]; CB_SYSCALL sc; @@ -716,7 +716,7 @@ bfin_initialize_cpu (SIM_DESC sd, SIM_CPU *cpu) SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, - struct bfd *abfd, char **argv) + struct bfd *abfd, char * const *argv) { char c; int i; @@ -807,7 +807,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, } /* Some utils don't like having a NULL environ. */ -static const char * const simple_env[] = { "HOME=/", "PATH=/bin", NULL }; +static char * const simple_env[] = { "HOME=/", "PATH=/bin", NULL }; static bu32 fdpic_load_offset; @@ -965,7 +965,7 @@ bfin_fdpic_load (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, bu32 *sp, static void bfin_user_init (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, - const char * const *argv, const char * const *env) + char * const *argv, char * const *env) { /* XXX: Missing host -> target endian ... */ /* Linux starts the user app with the stack: @@ -1147,7 +1147,7 @@ bfin_user_init (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, } static void -bfin_os_init (SIM_DESC sd, SIM_CPU *cpu, const char * const *argv) +bfin_os_init (SIM_DESC sd, SIM_CPU *cpu, char * const *argv) { /* Pass the command line via a string in R0 like Linux expects. */ int i; @@ -1184,7 +1184,7 @@ bfin_virtual_init (SIM_DESC sd, SIM_CPU *cpu) SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, - char **argv, char **env) + char * const *argv, char * const *env) { SIM_CPU *cpu = STATE_CPU (sd, 0); SIM_ADDR addr; @@ -1209,10 +1209,10 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, switch (STATE_ENVIRONMENT (sd)) { case USER_ENVIRONMENT: - bfin_user_init (sd, cpu, abfd, (void *)argv, (void *)env); + bfin_user_init (sd, cpu, abfd, argv, env); break; case OPERATING_ENVIRONMENT: - bfin_os_init (sd, cpu, (void *)argv); + bfin_os_init (sd, cpu, argv); break; default: bfin_virtual_init (sd, cpu); diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 6dc76f5de3f..f1b372b36d7 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-options.c (sim_parse_args): Mark argv array const. + * sim-options.h (sim_parse_args): Likewise. + 2016-01-05 Mike Frysinger * sim-trace.c: Include dis-asm.h. diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index ad8b1eb29b8..73935547fef 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -458,7 +458,7 @@ dup_arg_p (const char *arg) /* Called by sim_open to parse the arguments. */ SIM_RC -sim_parse_args (SIM_DESC sd, char **argv) +sim_parse_args (SIM_DESC sd, char * const *argv) { int c, i, argc, num_opts, save_opterr; char *p, *short_options; diff --git a/sim/common/sim-options.h b/sim/common/sim-options.h index 7d20382fd76..8086a37499d 100644 --- a/sim/common/sim-options.h +++ b/sim/common/sim-options.h @@ -135,7 +135,7 @@ SIM_RC sim_add_option_table (SIM_DESC sd, sim_cpu *cpu, const OPTION *table); MODULE_INSTALL_FN standard_install; /* Called by sim_open to parse the arguments. */ -SIM_RC sim_parse_args (SIM_DESC sd, char **argv); +SIM_RC sim_parse_args (SIM_DESC sd, char * const *argv); /* Print help messages for the options. IS_COMMAND is non-zero when this function is called from the command line interpreter. */ diff --git a/sim/cr16/ChangeLog b/sim/cr16/ChangeLog index dedaa6d0f5d..6540eedb23a 100644 --- a/sim/cr16/ChangeLog +++ b/sim/cr16/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index 9aa2062a99e..fd637081533 100644 --- a/sim/cr16/interp.c +++ b/sim/cr16/interp.c @@ -383,7 +383,8 @@ static int cr16_reg_fetch (SIM_CPU *, int, unsigned char *, int); static int cr16_reg_store (SIM_CPU *, int, unsigned char *, int); SIM_DESC -sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, + struct bfd *abfd, char * const *argv) { struct simops *s; struct hash_entry *h; @@ -645,7 +646,8 @@ sim_engine_run (SIM_DESC sd, } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { bfd_vma start_address; diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index e51ce98ab0c..66231ce3c86 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index 3b0b5466779..3bbc9fdb4f3 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -617,7 +617,7 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd) SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd, - char **argv) + char * const *argv) { char c; int i; @@ -959,8 +959,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd, SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, - char **argv ATTRIBUTE_UNUSED, - char **envp ATTRIBUTE_UNUSED) + char * const *argv ATTRIBUTE_UNUSED, + char * const *envp ATTRIBUTE_UNUSED) { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index 7d639fdc106..0941a346acf 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * endian.c (get_word): Delete all arch/big endian logic. diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index a49cd528be4..cb8c6cf61f5 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -746,7 +746,8 @@ static int d10v_reg_fetch (SIM_CPU *, int, unsigned char *, int); static int d10v_reg_store (SIM_CPU *, int, unsigned char *, int); SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { struct simops *s; struct hash_entry *h; @@ -1141,7 +1142,8 @@ sim_info (SIM_DESC sd, int verbose) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { bfd_vma start_address; diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog index 37620f94750..c9a3522cd0b 100644 --- a/sim/erc32/ChangeLog +++ b/sim/erc32/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interf.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c index 7f3b8dfee8c..826a85a5f6e 100644 --- a/sim/erc32/interf.c +++ b/sim/erc32/interf.c @@ -162,7 +162,7 @@ sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; struct host_callback_struct *callback; struct bfd *abfd; - char **argv; + char * const *argv; { int argc = 0; @@ -288,8 +288,8 @@ SIM_RC sim_create_inferior(sd, abfd, argv, env) SIM_DESC sd; struct bfd *abfd; - char **argv; - char **env; + char * const *argv; + char * const *env; { bfd_vma start_address = 0; if (abfd != NULL) diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog index ac9b3fb8190..684bcd595f1 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c index d4a61b337a0..910811fefaf 100644 --- a/sim/frv/sim-if.c +++ b/sim/frv/sim-if.c @@ -49,7 +49,7 @@ sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; bfd *abfd; - char **argv; + char * const *argv; { char c; int i; @@ -191,8 +191,8 @@ SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; bfd *abfd; - char **argv; - char **envp; + char * const *argv; + char * const *envp; { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/ft32/ChangeLog b/sim/ft32/ChangeLog index a08f8043ca5..7f98a34cfda 100644 --- a/sim/ft32/ChangeLog +++ b/sim/ft32/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c index a2d59b0784b..dcb5a7d9479 100644 --- a/sim/ft32/interp.c +++ b/sim/ft32/interp.c @@ -788,7 +788,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, - char **argv) + char * const *argv) { char c; size_t i; @@ -863,8 +863,8 @@ sim_open (SIM_OPEN_KIND kind, SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, - char **argv, - char **env) + char * const *argv, + char * const *env) { uint32_t addr; sim_cpu *cpu = STATE_CPU (sd, 0); diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 727c51454a1..544b745057f 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * compile.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 394167a601f..c1c61d8211b 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -4826,7 +4826,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, - char **argv) + char * const *argv) { int i; SIM_DESC sd; @@ -5000,7 +5000,8 @@ sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { int i = 0; int len_arg = 0; diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog index bcbe6fcd481..3d0d7f6006b 100644 --- a/sim/iq2000/ChangeLog +++ b/sim/iq2000/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c index f9ccf1f2186..b1646e1c3c3 100644 --- a/sim/iq2000/sim-if.c +++ b/sim/iq2000/sim-if.c @@ -54,7 +54,7 @@ sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; struct bfd *abfd; - char **argv; + char * const *argv; { char c; int i; @@ -142,8 +142,8 @@ SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; struct bfd *abfd; - char **argv; - char **envp; + char * const *argv; + char * const *envp; { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog index 8333d4535ae..9d3c2154a09 100644 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c index a135232f65f..860c1e63f1f 100644 --- a/sim/lm32/sim-if.c +++ b/sim/lm32/sim-if.c @@ -101,7 +101,7 @@ sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; struct bfd *abfd; - char **argv; + char * const *argv; { SIM_DESC sd = sim_state_alloc (kind, callback); char c; @@ -210,8 +210,8 @@ SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; struct bfd *abfd; - char **argv; - char **envp; + char * const *argv; + char * const *envp; { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog index 1d132dcea1b..e3ea0c8be2a 100644 --- a/sim/m32c/ChangeLog +++ b/sim/m32c/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c index 181e8edc10c..46e151bdaa9 100644 --- a/sim/m32c/gdb-if.c +++ b/sim/m32c/gdb-if.c @@ -60,7 +60,7 @@ static int open; SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, - struct bfd *abfd, char **argv) + struct bfd *abfd, char * const *argv) { setbuf (stdout, 0); if (open) @@ -144,7 +144,8 @@ sim_load (SIM_DESC sd, const char *prog, struct bfd * abfd, int from_tty) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd * abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd * abfd, + char * const *argv, char * const *env) { check_desc (sd); diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index f30b9e566e9..32cfa373875 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c index 435d8b6bda1..107865afeca 100644 --- a/sim/m32r/sim-if.c +++ b/sim/m32r/sim-if.c @@ -56,7 +56,7 @@ sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; struct bfd *abfd; - char **argv; + char * const *argv; { SIM_DESC sd = sim_state_alloc (kind, callback); char c; @@ -162,8 +162,8 @@ SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; struct bfd *abfd; - char **argv; - char **envp; + char * const *argv; + char * const *envp; { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index e7020d9612b..dcc363d1b92 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c index 25cea7c3d5f..ab205714306 100644 --- a/sim/m68hc11/interp.c +++ b/sim/m68hc11/interp.c @@ -418,7 +418,7 @@ static int m68hc11_reg_store (SIM_CPU *, int, unsigned char *, int); SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, - bfd *abfd, char **argv) + bfd *abfd, char * const *argv) { int i; SIM_DESC sd; @@ -547,7 +547,7 @@ sim_info (SIM_DESC sd, int verbose) SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, - char **argv, char **env) + char * const *argv, char * const *env) { return sim_prepare_for_program (sd, abfd); } diff --git a/sim/mcore/ChangeLog b/sim/mcore/ChangeLog index bc2cb31e4f0..04e6aee8ed0 100644 --- a/sim/mcore/ChangeLog +++ b/sim/mcore/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c index d50ca16a195..450948966d4 100644 --- a/sim/mcore/interp.c +++ b/sim/mcore/interp.c @@ -1341,7 +1341,8 @@ free_state (SIM_DESC sd) } SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -1413,7 +1414,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, + char * const *argv, char * const *env) { SIM_CPU *cpu = STATE_CPU (sd, 0); char ** avp; diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog index f8845b7160f..8b3f4b43e6e 100644 --- a/sim/microblaze/ChangeLog +++ b/sim/microblaze/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c index 86ae78c5b1a..142300eb513 100644 --- a/sim/microblaze/interp.c +++ b/sim/microblaze/interp.c @@ -385,7 +385,8 @@ free_state (SIM_DESC sd) } SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -457,7 +458,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, + char * const *argv, char * const *env) { SIM_CPU *cpu = STATE_CPU (sd, 0); diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index aee39b31975..12c8b6cbc1c 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/mips/interp.c b/sim/mips/interp.c index 0801ac17fd4..61ff400be1b 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -346,7 +346,8 @@ static int mips_reg_fetch (SIM_CPU *, int, unsigned char *, int); static int mips_reg_store (SIM_CPU *, int, unsigned char *, int); SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -999,7 +1000,8 @@ mips_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { #ifdef DEBUG diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 65ec3aeab07..fd5b235259e 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 8959b40ff2c..7f0655f3f47 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -95,7 +95,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, - char **argv) + char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -321,8 +321,8 @@ sim_open (SIM_OPEN_KIND kind, SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, - char **argv, - char **env) + char * const *argv, + char * const *env) { memset (&State, 0, sizeof (State)); if (prog_bfd != NULL) { diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog index e556c902c90..8e1752398a8 100644 --- a/sim/moxie/ChangeLog +++ b/sim/moxie/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index bcc9ad5d9c4..6de1aa01e4a 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -1172,7 +1172,8 @@ free_state (SIM_DESC sd) } SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -1275,7 +1276,8 @@ load_dtb (SIM_DESC sd, const char *filename) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, + char * const *argv, char * const *env) { char ** avp; int l, argc, i, tp; diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog index 02892801e86..3ef9051455a 100644 --- a/sim/msp430/ChangeLog +++ b/sim/msp430/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * msp430-sim.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-05 Mike Frysinger * msp430-sim.c (loader_write_mem): Delete. diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c index 74a600d2d88..5a6b3edca65 100644 --- a/sim/msp430/msp430-sim.c +++ b/sim/msp430/msp430-sim.c @@ -137,7 +137,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, - char **argv) + char * const *argv) { SIM_DESC sd = sim_state_alloc (kind, callback); char c; @@ -224,8 +224,8 @@ msp430_sim_close (SIM_DESC sd, int quitting) SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, - char **argv, - char **env) + char * const *argv, + char * const *env) { unsigned char resetv[2]; int c; diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index b5d1dd8ae5f..ae770ac9851 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim_calls.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure.ac (sim-bswap): Delete. diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c index d25b46c9563..470c95862a1 100644 --- a/sim/ppc/sim_calls.c +++ b/sim/ppc/sim_calls.c @@ -63,7 +63,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd, - char **argv) + char * const *argv) { callbacks = callback; @@ -165,8 +165,8 @@ sim_info (SIM_DESC sd, int verbose) SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd, - char **argv, - char **envp) + char * const *argv, + char * const *envp) { unsigned_word entry_point; TRACE(trace_gdb, ("sim_create_inferior(start_address=0x%x, ...)\n", diff --git a/sim/rl78/ChangeLog b/sim/rl78/ChangeLog index 3f9bf4ecfcd..a3f3106a53b 100644 --- a/sim/rl78/ChangeLog +++ b/sim/rl78/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * gdb-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/rl78/gdb-if.c b/sim/rl78/gdb-if.c index f9f9c1b2b6b..e21fc1d807b 100644 --- a/sim/rl78/gdb-if.c +++ b/sim/rl78/gdb-if.c @@ -64,7 +64,7 @@ static struct host_callback_struct *host_callbacks; SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, - struct bfd *abfd, char **argv) + struct bfd *abfd, char * const *argv) { if (open) fprintf (stderr, "rl78 minisim: re-opened sim\n"); @@ -188,7 +188,8 @@ sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty) /* Create inferior. */ SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { check_desc (sd); diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog index 5460ccb653d..dbe663460d8 100644 --- a/sim/rx/ChangeLog +++ b/sim/rx/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * gdb-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c index 008cc9391d5..eec53259c82 100644 --- a/sim/rx/gdb-if.c +++ b/sim/rx/gdb-if.c @@ -59,7 +59,7 @@ static int rx_sim_is_open; SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, - struct bfd *abfd, char **argv) + struct bfd *abfd, char * const *argv) { if (rx_sim_is_open) fprintf (stderr, "rx minisim: re-opened sim\n"); @@ -208,7 +208,8 @@ sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, + char * const *argv, char * const *env) { check_desc (sd); diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index b24b90664ff..4d5ba4fe46f 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 2f59c5c92c9..df29f9644a9 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -2378,7 +2378,8 @@ free_state (SIM_DESC sd) } SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) +sim_open (SIM_OPEN_KIND kind, host_callback *cb, + struct bfd *abfd, char * const *argv) { char **p; int i; @@ -2483,7 +2484,8 @@ parse_and_set_memory_size (SIM_DESC sd, const char *str) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, + char * const *argv, char * const *env) { /* Clear the registers. */ memset (&saved_state, 0, diff --git a/sim/sh64/ChangeLog b/sim/sh64/ChangeLog index 07c76f85127..149d6e1570d 100644 --- a/sim/sh64/ChangeLog +++ b/sim/sh64/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * sim-if.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/sh64/sim-if.c b/sim/sh64/sim-if.c index 907ee06a25c..5eb096f0ef6 100644 --- a/sim/sh64/sim-if.c +++ b/sim/sh64/sim-if.c @@ -51,7 +51,7 @@ sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; struct bfd *abfd; - char **argv; + char * const *argv; { char c; int i; @@ -148,8 +148,8 @@ SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; struct bfd *abfd; - char **argv; - char **envp; + char * const *argv; + char * const *envp; { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 37b29e82d01..d839a9a28cb 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,8 @@ +2016-01-06 Mike Frysinger + + * interp.c (sim_open): Mark argv const. + (sim_create_inferior): Mark argv and env const. + 2016-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/v850/interp.c b/sim/v850/interp.c index ef91d510e25..daf96180176 100644 --- a/sim/v850/interp.c +++ b/sim/v850/interp.c @@ -195,7 +195,7 @@ SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback * cb, struct bfd * abfd, - char ** argv) + char * const * argv) { int i; SIM_DESC sd = sim_state_alloc (kind, cb); @@ -309,8 +309,8 @@ sim_open (SIM_OPEN_KIND kind, SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd * prog_bfd, - char ** argv, - char ** env) + char * const *argv, + char * const *env) { memset (&State, 0, sizeof (State)); if (prog_bfd != NULL) -- 2.30.2