This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Catch errors in value_get_print_value
On Fri, Feb 09, 2007 at 11:18:52AM +1300, Nick Roberts wrote:
> > > Currently when common_val_print throws an error from install_new_value it gets
> > > caught in mi_execute_command and prints an MI error (^error,...) without
> > > cleaning up. This patch catches the error in value_get_print_value so that GDB
> > > can proceed normally. It could be adapted to output something like
> > > "<error_reading_variable>" but I think the empty string works better.
> >
> > Could you explain why? I would be confused to see an empty value in
> > my locals window. That's separate from this bug though.
>
> It's much quieter than a window full of error/warning messages. If there's no
> value available, the frontend doesn't show one. That seems logical to me but
> perhaps only because I'm used to it.
Well, maybe we could use in_scope="false" and no value, and let the
front end decide...
> Thanks. This is clearly a better patch as it's much simpler. Thinking more
> generally, I wonder if there are other cases where value_contents_all should
> catch this error?
I don't think so - would there be a sensible return value for
value_contents_all if something has gone wrong? Not really, so I think
it's the responsibility of other layers to detect it.
--
Daniel Jacobowitz
CodeSourcery