* completer.h (get_gdb_completer_word_break_characters): Delete.
authorJoel Brobecker <brobecker@gnat.com>
Mon, 6 Oct 2003 22:41:17 +0000 (22:41 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Mon, 6 Oct 2003 22:41:17 +0000 (22:41 +0000)
        * completer.c: include language.h.
        (gdb_completer_word_break_characters): Delete.
        (get_gdb_completer_word_break_characters): Delete.
        (location_completer): Use the word break characters of the current
        language.
        (complete_line): Likewise.
        (line_completion_function): Likewise.
        (skip_quoted_chars): Likewise.
        * Makefile.in (completer.o): Add dependency on language.h.
        * top.c (init_main): Set the readline word break characters
        to GDB's default word break characters.

gdb/ChangeLog
gdb/Makefile.in
gdb/completer.c
gdb/completer.h
gdb/top.c

index 1afa47e2909dffa4665faa84a6e8f74ae2787c0b..d08b904a7d308e41091afa4a2957560775ef3f0f 100644 (file)
@@ -1,3 +1,18 @@
+2003-10-06  J. Brobecker  <brobecker@gnat.com>
+
+       * completer.h (get_gdb_completer_word_break_characters): Delete.
+       * completer.c: include language.h.
+       (gdb_completer_word_break_characters): Delete.
+       (get_gdb_completer_word_break_characters): Delete.
+       (location_completer): Use the word break characters of the current
+       language.
+       (complete_line): Likewise.
+       (line_completion_function): Likewise.
+       (skip_quoted_chars): Likewise.
+       * Makefile.in (completer.o): Add dependency on language.h.
+       * top.c (init_main): Set the readline word break characters
+       to GDB's default word break characters.
+
 2003-10-06  J. Brobecker  <brobecker@gnat.com>
 
        * language.h (language_defn): new field, la_word_break_characters.
index d3cfd8c210e3413e8a3d473297d6f48b741ae27c..cdbb92a159eca0052da556879a695f56019c46ea 100644 (file)
@@ -1631,7 +1631,8 @@ coff-solib.o: coff-solib.c $(defs_h) $(frame_h) $(bfd_h) $(gdbcore_h) \
 complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \
        $(command_h) $(gdbcmd_h)
 completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
-       $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h)
+       $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h) \
+       $(language_h)
 copying.o: copying.c $(defs_h) $(command_h) $(gdbcmd_h)
 core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(regcache_h) \
        $(gdb_dirent_h) $(gdb_stat_h)
index 4274241b00e0f6757a93982693968ee0c6663e31..1ab71bea1887020000efc2fd5ea4b839783e521f 100644 (file)
@@ -23,6 +23,7 @@
 #include "gdbtypes.h"
 #include "expression.h"
 #include "filenames.h"         /* for DOSish file names */
+#include "language.h"
 
 #include "cli/cli-decode.h"
 
@@ -51,13 +52,11 @@ char *line_completion_function (const char *text, int matches, char *line_buffer
    it does affect how much stuff M-? lists.
    (2) If one of the matches contains a word break character, readline
    will quote it.  That's why we switch between
-   gdb_completer_word_break_characters and
+   current_language->la_word_break_characters() and
    gdb_completer_command_word_break_characters.  I'm not sure when
    we need this behavior (perhaps for funky characters in C++ symbols?).  */
 
 /* Variables which are necessary for fancy command line editing.  */
-static char *gdb_completer_word_break_characters =
-" \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
 
 /* When completing on command names, we remove '-' from the list of
    word break characters, since we use it in command names.  If the
@@ -90,12 +89,6 @@ static char *gdb_completer_quote_characters = "'";
 \f
 /* Accessor for some completer data that may interest other files. */
 
-char *
-get_gdb_completer_word_break_characters (void)
-{
-  return gdb_completer_word_break_characters;
-}
-
 char *
 get_gdb_completer_quote_characters (void)
 {
@@ -251,7 +244,7 @@ location_completer (char *text, char *word)
          colon = p;
          symbol_start = p + 1;
        }
-      else if (strchr (gdb_completer_word_break_characters, *p))
+      else if (strchr (current_language->la_word_break_characters(), *p))
        symbol_start = p + 1;
     }
 
@@ -399,7 +392,7 @@ complete_line (const char *text, char *line_buffer, int point)
      '-' character used in some commands.  */
 
   rl_completer_word_break_characters =
-    gdb_completer_word_break_characters;
+    current_language->la_word_break_characters();
 
       /* Decide whether to complete on a list of gdb commands or on symbols. */
   tmp_command = (char *) alloca (point + 1);
@@ -674,7 +667,7 @@ line_completion_function (const char *text, int matches, char *line_buffer, int
     /* Make sure the word break characters are set back to normal for the
        next time that readline tries to complete something.  */
     rl_completer_word_break_characters =
-      gdb_completer_word_break_characters;
+      current_language->la_word_break_characters();
 #endif
 
   return (output);
@@ -696,7 +689,7 @@ skip_quoted_chars (char *str, char *quotechars, char *breakchars)
     quotechars = gdb_completer_quote_characters;
 
   if (breakchars == NULL)
-    breakchars = gdb_completer_word_break_characters;
+    breakchars = current_language->la_word_break_characters();
 
   for (scan = str; *scan != '\0'; scan++)
     {
index 7a96951aae3ead727c8b34df53e7e94f3c5bdada..0a8e9fa8cfe540e8509574cb50a9461c8d9b599c 100644 (file)
@@ -31,8 +31,6 @@ extern char **location_completer (char *, char *);
 
 extern char **command_completer (char *, char *);
 
-extern char *get_gdb_completer_word_break_characters (void); 
-
 extern char *get_gdb_completer_quote_characters (void);
 
 /* Exported to linespec.c */
index baeaa9339213b043c6e3a08631302cc479845f4c..0e22c1fa3e8fa6fe502d0299319cdbdb9613a3e3 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1719,8 +1719,7 @@ init_main (void)
 
   /* Setup important stuff for command line editing.  */
   rl_completion_entry_function = readline_line_completion_function;
-  rl_completer_word_break_characters =
-                                get_gdb_completer_word_break_characters ();
+  rl_completer_word_break_characters = default_word_break_characters ();
   rl_completer_quote_characters = get_gdb_completer_quote_characters ();
   rl_readline_name = "gdb";
   rl_terminal_name = getenv ("TERM");