diff options
Diffstat (limited to 'sim/bfin/interp.c')
-rw-r--r-- | sim/bfin/interp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index 5ba204b..2da70b5 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -1210,10 +1210,11 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, addr = 0; sim_pc_set (cpu, addr); - /* Standalone mode (i.e. `bfin-...-run`) will take care of the argv - for us in sim_open() -> sim_parse_args(). But in debug mode (i.e. - 'target sim' with `bfin-...-gdb`), we need to handle it. */ - if (STATE_OPEN_KIND (sd) == SIM_OPEN_DEBUG) + /* 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); |