From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27635 invoked by alias); 2 Oct 2003 05:22:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27627 invoked from network); 2 Oct 2003 05:22:11 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 2 Oct 2003 05:22:11 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id A43CDD2D29; Wed, 1 Oct 2003 22:22:10 -0700 (PDT) Date: Thu, 02 Oct 2003 05:22:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA] Make word-break-characters language independent (1/3) Message-ID: <20031002052210.GT933@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-10/txt/msg00021.txt.bz2 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1382 This is the first patch of a series of 3 that follow up on a discussion about making the word_break_characters language dependent. See: http://sources.redhat.com/ml/gdb-patches/2003-09/msg00399.html. The plan is as follow: 1. Add a new function in language: default_word_break_characters() 2. Add a new field la_word_break_characters in struct language_defn Update all instances of this structure to set this new field to default_word_break_characters. 3. Remove gdb_completer_word_break_characters and get_gdb_completer_word_break_characters. Replace them with either default_word_break_characters or the current_language la_word_break_characters. In the end, GDB's behavior is entirely identical. But it will allow Ada to define it's own set of word-break-characters, allowing it to fine-tune the completion mechanism. I divided this change in 3 patches to show the process I used, and to show that the changes are mostly mechanical (and hopefully correct :-). If necessary, I can break them up further (for instance patch3 can be broken up in two steps), or submit all 3 of them in one patch. Let me know. Attached is the first patch. 2003-10-01 J. Brobecker * language.h (default_word_break_characters): Add prototype. * language.c (default_word_break_characters): New function. Ok to apply? -- Joel --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch1.diff" Content-length: 1261 Index: language.c =================================================================== RCS file: /cvs/src/src/gdb/language.c,v retrieving revision 1.38 diff -u -p -r1.38 language.c --- language.c 25 Sep 2003 08:40:45 -0000 1.38 +++ language.c 2 Oct 2003 04:59:56 -0000 @@ -1176,6 +1176,15 @@ language_demangle (const struct language return NULL; } +/* Return the default string containing the list of characters + delimiting words. This is a reasonable default value that + most languages should be able to use. */ + +char * +default_word_break_characters (void) +{ + return " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-"; +} /* Define the language that is no language. */ Index: language.h =================================================================== RCS file: /cvs/src/src/gdb/language.h,v retrieving revision 1.22 diff -u -p -r1.22 language.h --- language.h 25 Sep 2003 08:40:45 -0000 1.22 +++ language.h 2 Oct 2003 04:59:56 -0000 @@ -502,4 +502,7 @@ extern CORE_ADDR skip_language_trampolin extern char *language_demangle (const struct language_defn *current_language, const char *mangled, int options); +/* Splitting strings into words. */ +extern char *default_word_break_characters (void); + #endif /* defined (LANGUAGE_H) */ --u3/rZRmxL6MmkK24--