sim: keep track of program environment strings

We've been passing the environment strings to sim_create_inferior,
but most ports don't do anything with them.  A few will use ad-hoc
logic to stuff the stack for user-mode programs, but that's it.

Let's formalize this across the board by storing the strings in the
normal sim state.  This will allow (in future commits) supporting
more functionality in the run interface, and to unify some of the
libgloss syscalls.
This commit is contained in:
Mike Frysinger
2021-11-15 23:00:04 -05:00
parent 38f9e52086
commit 54f7a83a62
14 changed files with 85 additions and 7 deletions

View File

@ -99,6 +99,7 @@ sim_state_free (SIM_DESC sd)
free (STATE_PROG_FILE (sd));
free (STATE_PROG_ARGV0 (sd));
freeargv (STATE_PROG_ENVP (sd));
free (sd);
}