STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
if (trace_load_symbols (sd))
{
STATE_PROG_SYMS_COUNT (sd) =
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
switch (STATE_ENVIRONMENT (sd))
{
case USER_ENVIRONMENT:
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
- char *const *argv, char *const *envp)
+ char *const *argv, char *const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
char *prog_argv0;
#define STATE_PROG_ARGV0(sd) ((sd)->prog_argv0)
+ /* The program's environment. */
+ char **prog_envp;
+#define STATE_PROG_ENVP(sd) ((sd)->prog_envp)
+
/* The program's bfd. */
struct bfd *prog_bfd;
#define STATE_PROG_BFD(sd) ((sd)->prog_bfd)
free (STATE_PROG_FILE (sd));
free (STATE_PROG_ARGV0 (sd));
+ freeargv (STATE_PROG_ENVP (sd));
free (sd);
}
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
- char * const *argv ATTRIBUTE_UNUSED,
- char * const *envp ATTRIBUTE_UNUSED)
+ char * const *argv,
+ char * const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
\f
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, bfd *abfd, char * const *argv,
- char * const *envp)
+ char * const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
freeargv (STATE_PROG_ARGV (sd));
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
cpu->state.regs[FT32_HARD_SP] = addr;
cpu->state.num_i = 0;
cpu->state.cycles = 0;
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
- char * const *envp)
+ char * const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
- char * const *envp)
+ char * const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
- char * const *envp)
+ char * const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
initialize_env (sd, (void *)argv, (void *)env);
return SIM_RC_OK;