enum bfd_endian target_endian;
+ /* Program command line options. */
+ char **argv;
+
+ /* Program environment. */
+ char **envp;
+
/* Size of an "int" on the target (for syscalls whose ABI uses "int").
This must include padding, and only padding-at-higher-address is
supported. For example, a 64-bit target with 32-bit int:s which
char * const *argv, char * const *env)
{
sim_cpu *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
bfd_vma addr = 0;
if (abfd != NULL)
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
if (trace_load_symbols (sd))
{
STATE_PROG_SYMS_COUNT (sd) =
char * const *argv, char * const *env)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
SIM_ADDR addr;
/* Set the PC. */
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
switch (STATE_ENVIRONMENT (sd))
{
case USER_ENVIRONMENT:
#include <stdlib.h>
+#include "sim/callback.h"
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
char *const *argv, char *const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
SIM_ADDR addr;
/* Determine the start address.
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
/* Defaults expected to be overridden at initialization, where needed. */
BFD_ENDIAN_UNKNOWN, /* target_endian */
+ NULL, /* argv */
+ NULL, /* envp */
4, /* target_sizeof_int */
HOST_CALLBACK_MAGIC,
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+
#include "libiberty.h"
#include "bfd.h"
#include "elf-bfd.h"
+#include "sim/callback.h"
#include "sim-main.h"
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
#include "sim-options.h"
#include "sim-hw.h"
#include "dis-asm.h"
/* Find out how much room is needed for the environment and argv, create
that memory and fill it. Only do this when there's a program
- specified. */
+ specified.
+
+ TODO: Move this to sim_create_inferior and use STATE_PROG_ENVP. */
if (abfd != NULL && !cris_bare_iron)
{
const char *name = bfd_get_filename (abfd);
char * const *env)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
SIM_ADDR addr;
if (sd != NULL)
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
\f
/* This must come before any other includes. */
#include "defs.h"
+#include "sim/callback.h"
#include "sim-main.h"
#include "sim-options.h"
\f
char * const *argv, char * const *env)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
sim_cia addr;
/* Set the PC. */
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
+#include "sim/callback.h"
+
#define WANT_CPU
#define WANT_CPU_FRVBF
#include "sim-main.h"
-#include <stdlib.h>
#include "sim-options.h"
#include "libiberty.h"
#include "bfd.h"
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_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
{
uint32_t addr;
sim_cpu *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
/* Set the PC. */
if (abfd != NULL)
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
cpu->state.regs[FT32_HARD_SP] = addr;
cpu->state.num_i = 0;
cpu->state.cycles = 0;
#include <stdlib.h>
+#include "sim/callback.h"
#include "sim-options.h"
#include "libiberty.h"
#include "bfd.h"
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_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
+#include "sim/callback.h"
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
#include "bfd.h"
-
-#include <stdlib.h>
\f
/* Cover function of sim_state_free to free the cpu buffers as well. */
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_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
/* 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 */
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_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
char * const *argv, char * const *env)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
SIM_ADDR addr;
addr = bfd_get_start_address (prog_bfd);
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
return SIM_RC_OK;
}
/* This must come before any other includes. */
#include "defs.h"
+#include "sim/callback.h"
#include "sim-main.h"
#include "sim-options.h"
\f
char * const *argv, char * const *env)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
SIM_ADDR addr;
/* Set the PC. */
STATE_PROG_ENVP (sd) = dupargv (env);
}
+ cb->argv = STATE_PROG_ARGV (sd);
+ cb->envp = STATE_PROG_ENVP (sd);
+
initialize_env (sd, (void *)argv, (void *)env);
return SIM_RC_OK;