On Wed, Dec 30, 2009 at 06:32:14PM +0100, Laurent Desnogues wrote: > > @@ -370,13 +385,21 @@ uint32_t do_arm_semihosting(CPUState *env) > > return syscall_err; > > #endif > > case SYS_GET_CMDLINE: > > -#ifdef CONFIG_USER_ONLY > > - /* Build a commandline from the original argv. */ > > { > > - char **arg = ts->info->host_argv; > > int len = ARG(1); > > /* lock the buffer on the ARM side */ > > char *cmdline_buffer = (char*)lock_user(VERIFY_WRITE, ARG(0), > > len, 0); > > +#ifdef CONFIG_USER_ONLY > > + /* Build a commandline from the original argv. */ > > + char **arg = ts->info->host_argv; > > Did you check this works? I think it doesn't since host_argv > field is being assigned target_argv, defined in main. And > target_argv is freed in main before starting simulation...
Well, that's possible - but that code was there already; I only moved the CONFIG_USER_ONLY case down a couple of lines. I don't recall why there's user-mode support in this file. -- Daniel Jacobowitz CodeSourcery