This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][python] Fix python/14513
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 02 Oct 2013 10:30:27 +0100
- Subject: Re: [patch][python] Fix python/14513
- Authentication-results: sourceware.org; auth=none
- References: <5239A7E9 dot 8010202 at redhat dot com> <877gedub9p dot fsf at fleche dot redhat dot com> <523A0E4E dot 3090105 at redhat dot com> <8738p1uam6 dot fsf at fleche dot redhat dot com>
On 18/09/13 21:40, Tom Tromey wrote:
>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
>
> Phil> If you look at the testsuite for py-param, they do have this option.
>
> Oh right! I forgot about that, sorry.
>
> Phil> What do you think?
>
> Ugh. Well, while we don't actually promise to print anything, it seems
> weird to require a string result just to throw it away. How about we
> remove the "else" clause and not print anything at all if the
> get_set_string method is not implemented? This ought to clean up most
> uses.
I think you mean the else clause in the py-param.c code? If so, we
cannot remove it as it preserves < 7.3 API:
else
{
/* We have to preserve the existing < GDB 7.3 API. If a
callback function does not exist, then attempt to read the
set_doc attribute. */
set_doc_string = get_doc_string (obj, set_doc_cst);
}
I am not sure what the resolution is here. At some point we have to
decide whether we have anything valid to print. We can hoist the
fprint into both of these branches, but even in the "else" clause we
have to check if we actually have anything as the fprint adds a
newline to the set documentation:
fprintf_filtered (gdb_stdout, "%s\n", set_doc_string);
What are your thoughts on this?
Cheers,
Phil