mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 17:40:49 +00:00
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).
This commit is contained in:
@@ -21,12 +21,13 @@
|
||||
/* 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>
|
||||
|
||||
/* Cover function of sim_state_free to free the cpu buffers as well. */
|
||||
|
||||
@@ -195,6 +196,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)
|
||||
@@ -219,5 +221,8 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user