/* Main simulator entry points specific to the M32R.
- Copyright (C) 1996-2021 Free Software Foundation, Inc.
+ Copyright (C) 1996-2022 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB, the GNU debugger.
/* This must come before any other includes. */
#include "defs.h"
+#include <string.h>
+#include <stdlib.h>
+
+#include "sim/callback.h"
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
#include "bfd.h"
-#include <string.h>
-#include <stdlib.h>
-
#include "dv-m32r_uart.h"
#define M32R_DEFAULT_MEM_SIZE 0x2000000 /* 32M */
\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);
+ host_callback *cb = STATE_CALLBACK (sd);
SIM_ADDR addr;
if (abfd != NULL)
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}