]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/frv/sim-if.c
sim: callback: expose argv & environ
[thirdparty/binutils-gdb.git] / sim / frv / sim-if.c
index 7b0913dad014389f60450326f2e962a86ed6f97f..c6340770f8ee220a014873a81e001fa48abeffb9 100644 (file)
@@ -20,10 +20,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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"
@@ -178,6 +181,7 @@ sim_create_inferior (SIM_DESC sd, 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)
@@ -202,5 +206,8 @@ sim_create_inferior (SIM_DESC sd, 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;
 }