From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9288 invoked by alias); 8 Oct 2002 23:22:30 -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 9280 invoked from network); 8 Oct 2002 23:22:30 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Oct 2002 23:22:30 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g98N2mX08767 for ; Tue, 8 Oct 2002 19:02:48 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g98NMCl01338; Tue, 8 Oct 2002 19:22:12 -0400 Received: from redhat.com (dhcp-172-16-25-149.sfbay.redhat.com [172.16.25.149]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g98NMBN28588; Tue, 8 Oct 2002 16:22:11 -0700 Message-ID: <3DA3685D.CE1E2E80@redhat.com> Date: Tue, 08 Oct 2002 16:22:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Adam Fedor CC: gdb-patches@sources.redhat.com, jimb@redhat.com Subject: Re: [PATCH] Redefine skip_quoted References: <3D9E541D.8010007@doc.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00187.txt.bz2 Adam Fedor wrote: > > 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). I think you need Jim or Elena's buy-in for the change in linespec.c, but I'll approve the rest. Jim, Elena's on vacation -- can you give a quick look at this? > > 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. > > ------------------------------------------------------------------------------- > 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] != '\'')