aboutsummaryrefslogtreecommitdiff
path: root/sim/frv
diff options
context:
space:
mode:
Diffstat (limited to 'sim/frv')
-rw-r--r--sim/frv/ChangeLog4
-rw-r--r--sim/frv/sim-if.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 549ff72..936bbf2 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-26 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_create_inferior): Replace old #if 0 code with dupargv.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* devices.c: Delete file.
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index f908778..f530763 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -213,10 +213,15 @@ sim_create_inferior (sd, abfd, argv, envp)
addr = 0;
sim_pc_set (current_cpu, addr);
-#if 0
- STATE_ARGV (sd) = sim_copy_argv (argv);
- STATE_ENVP (sd) = sim_copy_argv (envp);
-#endif
+ /* Standalone mode (i.e. `run`) will take care of the argv for us in
+ sim_open() -> sim_parse_args(). But in debug mode (i.e. 'target sim'
+ with `gdb`), we need to handle it because the user can change the
+ argv on the fly via gdb's 'run'. */
+ if (STATE_PROG_ARGV (sd) != argv)
+ {
+ freeargv (STATE_PROG_ARGV (sd));
+ STATE_PROG_ARGV (sd) = dupargv (argv);
+ }
return SIM_RC_OK;
}