This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][python] Fix python/14513


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]