This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix "Segmentation fault" when "gdb -v"
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Thu, 4 Mar 2010 11:26:20 +0400
- Subject: Re: [RFA] Fix "Segmentation fault" when "gdb -v"
- References: <daef60381003032250j42f46f4cqacf0ba2975fb9b6d@mail.gmail.com>
> 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