sim: split program path out of argv vector
authorMike Frysinger <vapier@gentoo.org>
Mon, 15 Nov 2021 07:32:06 +0000 (02:32 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 15 Nov 2021 07:53:29 +0000 (02:53 -0500)
commite8f20a28b1192d746475f045d77ac84411f164df
tree3ff31f3c32862561e65c1d23650b13eb0c28702a
parent7b2ec4e46fb726a7616a07e67c4270f48c8c546e
sim: split program path out of argv vector

We use the program argv to both find the program to run (argv[0]) and
to hold the arguments to the program.  Most of the time this is fine,
but if we want to let programs specify argv[0] independently (which is
possible in standard *NIX programs), this double duty doesn't work.

So let's split the path to the program to run out into a separate
field by itself.  This simplifies the various sim_open funcs too.

By itself, this code is more of a logical cleanup than something that
is super useful.  But it will open up customization of argv[0] in a
follow up commit.  Split the changes to make it easier to review.
31 files changed:
sim/aarch64/interp.c
sim/arm/wrapper.c
sim/avr/interp.c
sim/bfin/interp.c
sim/bpf/sim-if.c
sim/common/nrun.c
sim/common/sim-base.h
sim/common/sim-options.c
sim/common/sim-utils.c
sim/cr16/interp.c
sim/cris/sim-if.c
sim/d10v/interp.c
sim/example-synacor/interp.c
sim/frv/sim-if.c
sim/ft32/interp.c
sim/h8300/compile.c
sim/iq2000/sim-if.c
sim/lm32/sim-if.c
sim/m32r/sim-if.c
sim/m68hc11/interp.c
sim/mcore/interp.c
sim/microblaze/interp.c
sim/mips/interp.c
sim/mn10300/interp.c
sim/moxie/interp.c
sim/msp430/msp430-sim.c
sim/or1k/sim-if.c
sim/pru/interp.c
sim/riscv/interp.c
sim/sh/interp.c
sim/v850/interp.c