[RFA] Fix "Segmentation fault" when "gdb -v"

Joel Brobecker brobecker@adacore.com
Thu Mar 4 07:26:00 GMT 2010


> All of this code use "printf_filtered".  But this function must be
> call after "interp_set".
> But this part of code call before "interp_set".

I think that this was an unforseen side-effect of a recent change.
IMO, it's better to get rid of this side-effect (needing the interpreter
to be set) in printf_filtered.

We should NOT change printf_filtered into printf_unfiltered in this case
because the same function is used in two different situations:
  - when the user uses -v
  - when the user types "show version"
In the latter case, the printf_filtered is appropriate.

Now, we need to decide whether pagination should be enabled if
the interpreter is not set. I think it makes sense to disable pagination
in this case.  If the interpreter is not set yet, we're just printing
stuff on stdout, we haven't started the interactive session (if any) yet...

-- 
Joel



More information about the Gdb-patches mailing list