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: [RFA] completer test [was Re: [RFC] Cleanup for make_source_files_completion_list]


On Wednesday, May 15 2013, Keith Seitz wrote:

> On 05/15/2013 03:33 PM, Sergio Durigan Junior wrote:
>> Wouldn't it be better to use the "complete" command?  Here is what I see
>> when I use it:
>>
>>      (gdb) complete break filesy
>>      break filesym
>>      break filesym.c
>
> Is that necessarily "better" than testing what a user would actually
> type? I don't know. gdb.base/completion.exp uses both forms.

AFAIU "complete" is a non-interactive form of \t\t (maybe written
exactly to make the testing process easier), and both forms should work
correspondingly.  If they doesn't, that's readline's issue.

Anyway, when I said "better" I mean "clearer".  The code could be a lot
simpler than it is.  But I will definitely not bikeshed on this :-).

>> Also, ISTR "send_gdb" is deprecated, and one should use
>> "gdb_test_multiple" instead.  WDYT?
>
> Is send_gdb deprecated or gdb_expect? Or is their direct use discouraged?

ISTR their direct use is discouraged, yes.  Sorry for the confusion.

> This is the first I've heard of send_gdb being deprecated. As far as I
> can tell, there is no other way to directly test completion this
> way. I do see, though, that completion.exp uses gdb_test_multiple
> instead of gdb_expect... If it truly is deprecated, I would expect
> send_gdb to be made "private" in some way. [deprecated_send_gdb?] Or
> at least mentioned in lib/gdb.exp.

As I said above, their usage is discouraged, but there are still lots
and lots of old places which use them.

> If there is a preference for one or the other [or an actual policy], I
> will certainly make necessary changes.

Sure, I'd wait for a maintainer's opinion on that, just in case...

> Thank you for bringing this up.

My pleasure.  And thanks for the patch!

-- 
Sergio


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