From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3360 invoked by alias); 5 Oct 2002 02:53:01 -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 3351 invoked from network); 5 Oct 2002 02:53:00 -0000 Received: from unknown (63.119.183.65) by sources.redhat.com with QMTP; 5 Oct 2002 02:53:00 -0000 Received: (qmail 27572 invoked from network); 5 Oct 2002 01:52:41 -0000 Received: from cpe-24-221-209-215.co.sprintbbd.net (HELO doc.com) (24.221.209.215) by external1 with SMTP; 5 Oct 2002 01:52:41 -0000 Message-ID: <3D9E541D.8010007@doc.com> Date: Fri, 04 Oct 2002 19:53:00 -0000 From: Adam Fedor Organization: Digital Optics Corp. User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0.0) Gecko/20020610 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [PATCH] Redefine skip_quoted Content-Type: multipart/mixed; boundary="------------030004080608000105040006" X-SW-Source: 2002-10/txt/msg00145.txt.bz2 This is a multi-part message in MIME format. --------------030004080608000105040006 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 658 Objective-C has a different idea of what word break characters are. Hence this patch (although the new usage isn't actually apparent in this patch). 2002-10-04 Adam Fedor * Makefile.in (c-exp.tab.o): Add $(completer_h) to dependancies. (jv-exp.tarb.o): Likewise. (p-exp.tab.o): Likewise. * completer.c (skip_quoted): Take additional "word break characters" argument. * completer.h: Update definition of skip_quoted. * defs.h (skip_quoted): Delete, declared in completer.h. * c-exp.y: Include completer.h. Update definition of skip_quoted. * p-exp.y: Likewise. * jv-exp.y: Likewise. * linespec.c (decode_line_1): Likewise. --------------030004080608000105040006 Content-Type: text/plain; name="objc3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="objc3.patch" Content-length: 7511 Index: gdb/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.268 diff -u -p -r1.268 Makefile.in --- gdb/Makefile.in 2 Oct 2002 21:33:58 -0000 1.268 +++ gdb/Makefile.in 5 Oct 2002 02:49:03 -0000 @@ -1433,12 +1433,12 @@ z8k-tdep.o: $(srcdir)/z8k-tdep.c c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \ - $(charset_h) \ + $(charset_h) $(completer_h) \ $(symfile_h) $(objfiles_h) jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(completer_h) f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \ @@ -1450,7 +1450,7 @@ m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(e p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(completer_h) ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \ $(defs_h) $(expression_h) \ Index: gdb/c-exp.y =================================================================== RCS file: /cvs/src/src/gdb/c-exp.y,v retrieving revision 1.15 diff -u -p -r1.15 c-exp.y --- gdb/c-exp.y 20 Sep 2002 00:24:01 -0000 1.15 +++ gdb/c-exp.y 5 Oct 2002 02:49:10 -0000 @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ #include "charset.h" +#include "completer.h" /* Flag indicating we're dealing with HP-compiled objects */ extern int hp_som_som_object_present; @@ -1331,7 +1332,9 @@ yylex () c = *lexptr++; if (c != '\'') { - namelen = skip_quoted (tokstart) - tokstart; + namelen = skip_quoted (tokstart, + get_gdb_completer_word_break_characters()) + - tokstart; if (namelen > 2) { lexptr = tokstart + namelen; Index: gdb/completer.c =================================================================== RCS file: /cvs/src/src/gdb/completer.c,v retrieving revision 1.11 diff -u -p -r1.11 completer.c --- gdb/completer.c 24 Mar 2002 00:40:35 -0000 1.11 +++ gdb/completer.c 5 Oct 2002 02:49:11 -0000 @@ -683,7 +683,7 @@ line_completion_function (char *text, in location after the "word". */ char * -skip_quoted (char *str) +skip_quoted (char *str, char *breakchars) { char quote_char = '\0'; char *scan; @@ -705,7 +705,7 @@ skip_quoted (char *str) /* Found start of a quoted string. */ quote_char = *scan; } - else if (strchr (gdb_completer_word_break_characters, *scan)) + else if (strchr (breakchars, *scan)) { break; } Index: gdb/completer.h =================================================================== RCS file: /cvs/src/src/gdb/completer.h,v retrieving revision 1.6 diff -u -p -r1.6 completer.h --- gdb/completer.h 18 Feb 2002 01:12:38 -0000 1.6 +++ gdb/completer.h 5 Oct 2002 02:49:11 -0000 @@ -39,6 +39,6 @@ extern char *get_gdb_completer_quote_cha /* Exported to linespec.c */ -extern char *skip_quoted (char *str); +extern char *skip_quoted (char *str, char *); #endif /* defined (COMPLETER_H) */ Index: gdb/defs.h =================================================================== RCS file: /cvs/src/src/gdb/defs.h,v retrieving revision 1.99 diff -u -p -r1.99 defs.h --- gdb/defs.h 27 Sep 2002 22:08:51 -0000 1.99 +++ gdb/defs.h 5 Oct 2002 02:49:13 -0000 @@ -532,8 +532,6 @@ extern void print_transfer_performance ( typedef void initialize_file_ftype (void); -extern char *skip_quoted (char *); - extern char *gdb_readline (char *); extern char *gdb_readline_wrapper (char *); Index: gdb/jv-exp.y =================================================================== RCS file: /cvs/src/src/gdb/jv-exp.y,v retrieving revision 1.11 diff -u -p -r1.11 jv-exp.y --- gdb/jv-exp.y 19 Sep 2002 03:58:41 -0000 1.11 +++ gdb/jv-exp.y 5 Oct 2002 02:49:14 -0000 @@ -48,6 +48,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "completer.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple @@ -918,7 +919,9 @@ yylex () c = *lexptr++; if (c != '\'') { - namelen = skip_quoted (tokstart) - tokstart; + namelen = skip_quoted (tokstart, + get_gdb_completer_word_break_characters()) + - tokstart; if (namelen > 2) { lexptr = tokstart + namelen; Index: gdb/linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.23 diff -u -p -r1.23 linespec.c --- gdb/linespec.c 22 Sep 2002 22:18:41 -0000 1.23 +++ gdb/linespec.c 5 Oct 2002 02:49:14 -0000 @@ -761,7 +761,8 @@ decode_line_1 (char **argptr, int funfir && strchr (get_gdb_completer_quote_characters (), **argptr) != NULL) { - p = skip_quoted (*argptr); + p = skip_quoted (*argptr, + get_gdb_completer_word_break_characters()); *argptr = *argptr + 1; } else @@ -1094,10 +1095,14 @@ decode_line_1 (char **argptr, int funfir Find the next token (everything up to end or next whitespace). */ if (**argptr == '$') /* May be a convenience variable */ - p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1)); /* One or two $ chars possible */ + { + /* One or two $ chars possible */ + p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1), + get_gdb_completer_word_break_characters()); + } else if (is_quoted) { - p = skip_quoted (*argptr); + p = skip_quoted (*argptr, get_gdb_completer_word_break_characters()); if (p[-1] != '\'') error ("Unmatched single quote."); } @@ -1107,7 +1112,7 @@ decode_line_1 (char **argptr, int funfir } else { - p = skip_quoted (*argptr); + p = skip_quoted (*argptr, get_gdb_completer_word_break_characters()); } copy = (char *) alloca (p - *argptr + 1); Index: gdb/p-exp.y =================================================================== RCS file: /cvs/src/src/gdb/p-exp.y,v retrieving revision 1.15 diff -u -p -r1.15 p-exp.y --- gdb/p-exp.y 19 Sep 2002 03:58:41 -0000 1.15 +++ gdb/p-exp.y 5 Oct 2002 02:49:15 -0000 @@ -56,6 +56,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "completer.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple @@ -1100,8 +1101,10 @@ yylex () c = *lexptr++; if (c != '\'') { - namelen = skip_quoted (tokstart) - tokstart; - if (namelen > 2) + namelen = skip_quoted (tokstart, + get_gdb_completer_word_break_characters()) + - tokstart; + if (namelen > 2) { lexptr = tokstart + namelen; if (lexptr[-1] != '\'') --------------030004080608000105040006--