summaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2000-12-01 00:43:47 +0000
committerFernando Nasser <fnasser@redhat.com>2000-12-01 00:43:47 +0000
commit01353010a3085e6cbae64cd170b8fa239299b096 (patch)
treeb6929cc6927b676f47e0a4e0e92cc7b3c08452a7 /gdb/linespec.c
parentd41344bbe6eadfc8f48ec60536f9f3340c391c75 (diff)
downloadgdb-01353010a3085e6cbae64cd170b8fa239299b096.tar.gz
2000-11-30 Fernando Nasser <fnasser@redhat.com>
* linespec.h: New file. Declarations for linespec.c. * linespec.c, alpha-tdep.c, breakpoint.c, parse.c, source.c, symtab.c, tracepoint.c: Include the above. * completer.c: New file. Line completion stuff for GDB. (get_gdb_completer_word_break_characters, get_gdb_completer_quote_characters): New functions. Accessors for useful completer internal data. (filename_completer, line_completion_function, skip_quoted): Moved here from top.c. * completer.h: New file. Declarations for the above. * linespec.c (decode_line_1): Use get_gdb_completer_word_break_characters and get_gdb_completer_quote_characters. * top.c: Include completer.h. (filename_completer, line_completion_function, skip_quoted): Moved to completer.c. * corefile.c, exec.c, source.c, symfile.c, linespec.c: Include completer.h. * Makefile.in (SFILES): Add completer.c. (COMMON_OBS): Add completer.o. (completer.o): New target. (linespec.o, alpha-tdep.o, breakpoint.o, parse.o, source.o, symtab.o, tracepoint.o): Add linespec.h to dependencies list. (corefile.o, exec.o, source.o, symfile.o, linespec.o): Add completer.h to dependencies list.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 4d3af751df9..d6c330255c7 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -21,12 +21,13 @@
#include "defs.h"
#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame.h"
+#include "command.h"
#include "symfile.h"
#include "objfiles.h"
-#include "gdbcmd.h"
#include "demangle.h"
-#include "inferior.h"
+#include "value.h"
+#include "completer.h"
/* Prototype for one function in parser-defs.h,
instead of including that entire file. */
@@ -573,7 +574,8 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
/* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
is_quoted = (**argptr
- && strchr (gdb_completer_quote_characters, **argptr) != NULL);
+ && strchr (get_gdb_completer_quote_characters (),
+ **argptr) != NULL);
has_parens = ((pp = strchr (*argptr, '(')) != NULL
&& (pp = strrchr (pp, ')')) != NULL);
@@ -727,7 +729,8 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
/* Arg token is not digits => try it as a function name
Find the next token(everything up to end or next blank). */
if (**argptr
- && strchr (gdb_completer_quote_characters, **argptr) != NULL)
+ && strchr (get_gdb_completer_quote_characters (),
+ **argptr) != NULL)
{
p = skip_quoted (*argptr);
*argptr = *argptr + 1;
@@ -766,7 +769,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
copy[p - *argptr] = '\0';
if (p != *argptr
&& copy[p - *argptr - 1]
- && strchr (gdb_completer_quote_characters,
+ && strchr (get_gdb_completer_quote_characters (),
copy[p - *argptr - 1]) != NULL)
copy[p - *argptr - 1] = '\0';
}
@@ -1097,7 +1100,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if (p != *argptr
&& copy[0]
&& copy[0] == copy[p - *argptr - 1]
- && strchr (gdb_completer_quote_characters, copy[0]) != NULL)
+ && strchr (get_gdb_completer_quote_characters (), copy[0]) != NULL)
{
copy[p - *argptr - 1] = '\0';
copy++;