On Thursday 14 January 2010 18:49:10 Pedro Alves wrote: > > @@ -87,6 +88,10 @@ free_inferior (struct inferior *inf) > > { > > discard_all_inferior_continuations (inf); > > inferior_free_data (inf); > > + xfree (inf->args); > > + xfree (inf->argv); > > + xfree (inf->terminal); > > + free_environ (inf->environment); > > xfree (inf->private); > > Maybe I confused you with saying "shallow" copy. This > argv comes from a direct `argv' pointer copy: ... > This is only called from captured_main, like so: > > set_inferior_args_vector (argc - optind, &argv[optind]); ... > so, freeing that would be equivalent to: > > int > main (int argc, char **argv) > { > free (argv); > } > > which is not kosher (try it). You should _not_ free inferior->argv. Ouch. Here's yet another revision. > >qr > Warning: trailing whitespace in lines 230,238 of gdb/solib.c > Warning: trailing whitespace in lines 664,673,683 of gdb/main.c > Warning: trailing whitespace in line 266 of gdb/mi/mi-cmd-env.c > Warning: trailing whitespace in lines 129,186,200,213,2653,2654,2655 of gdb/infcmd.c > Refreshed patch per-inferior-args3.diff Also fixed now. - Volodya