From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: Daniel Berlin Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Improve completion of locations Date: Sun, 06 May 2001 02:05:00 -0000 Message-id: References: X-SW-Source: 2001-05/msg00066.html On Sun, 6 May 2001, Daniel Berlin wrote: > I can make it fail miserably with a simple example (IE my first > try). > > Try the following: > #include > class fred > { > public: > int bob(); > }; > int fred::bob() > { > return 5; > } > int main(void) > { > fred test; > test.bob(); > } Thanks for the example. > Complete on 'fred > It'll list fred and fred::bob(void) > > Hit enter (you need to clear the completion status to make it redo the > list) > > Complete on 'fred: > > It'll list every symbol around (Or at least, 3792 of them, i would > imagine this is every single one, i never checked) > > Complete on 'fred:: > It'll complete to fred::bob(void) > > The first is fine > The third is fine > The second is what your patch breaks right now. Well, I'd hardly call this ``fail miserably''. It is also simple to fix; I'll post a modified patch soon. > It'll also break completion without quotes when i get around to rewriting > those amazingly complex parsing routines. I'm sorry, I don't follow: which parsing routines did you refer to? Does the code I wrote use them? > Would anyone really object if i just started a flex based lexer to parse > the specs, to replace all this silly ad-hoc parsing. Note that Readline has its own ideas about breaking user input into ``words'', and it does that even before our completion functions are called. So, in contrast to our code which parses the full location spec, completion cannot be much smarter than it currently is, because Readline doesn't give us a chance to be smarter. Most of the time I debugged this code went into trying to get along with Readline's idiosyncrasies. Thanks again for the feedback.