aboutsummaryrefslogtreecommitdiff
path: root/sim/ft32
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-15 23:04:10 -0500
committerMike Frysinger <vapier@gentoo.org>2021-11-16 01:13:39 -0500
commit8cfc9a1895d9f720e2cc38fd57b94ca5efba07b1 (patch)
treeebec67af6051c58a695f48b6f69d6bf005fd3116 /sim/ft32
parent54f7a83a62c27d6da9ee66da1022572d6ea45d84 (diff)
downloadgdb-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/ft32')
-rw-r--r--sim/ft32/interp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index 2838395..3514f75 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -884,6 +884,7 @@ sim_create_inferior (SIM_DESC sd,
{
uint32_t addr;
sim_cpu *cpu = STATE_CPU (sd, 0);
+ host_callback *cb = STATE_CALLBACK (sd);
/* Set the PC. */
if (abfd != NULL)
@@ -907,6 +908,9 @@ sim_create_inferior (SIM_DESC sd,
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;