diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-11-15 23:04:10 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-11-16 01:13:39 -0500 |
commit | 8cfc9a1895d9f720e2cc38fd57b94ca5efba07b1 (patch) | |
tree | ebec67af6051c58a695f48b6f69d6bf005fd3116 /sim/m32r | |
parent | 54f7a83a62c27d6da9ee66da1022572d6ea45d84 (diff) | |
download | gdb-8cfc9a1895d9f720e2cc38fd57b94ca5efba07b1.zip gdb-8cfc9a1895d9f720e2cc38fd57b94ca5efba07b1.tar.gz gdb-8cfc9a1895d9f720e2cc38fd57b94ca5efba07b1.tar.bz2 |
sim: callback: expose argv & environ
Pass the existing strings data to the callbacks so that common
libgloss syscalls can be implemented (which we'll do shortly).
Diffstat (limited to 'sim/m32r')
-rw-r--r-- | sim/m32r/sim-if.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c index 0cb49a1..084ed5a 100644 --- a/sim/m32r/sim-if.c +++ b/sim/m32r/sim-if.c @@ -20,14 +20,15 @@ /* 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 */ @@ -148,6 +149,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv, char * const *env) { SIM_CPU *current_cpu = STATE_CPU (sd, 0); + host_callback *cb = STATE_CALLBACK (sd); SIM_ADDR addr; if (abfd != NULL) @@ -180,6 +182,9 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv, STATE_PROG_ENVP (sd) = dupargv (env); } + cb->argv = STATE_PROG_ARGV (sd); + cb->envp = STATE_PROG_ENVP (sd); + return SIM_RC_OK; } |