Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: Adam Fedor <fedor@doc.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Redefine skip_quoted
Date: Mon, 14 Oct 2002 13:47:00 -0000	[thread overview]
Message-ID: <vt2bs5wu5ks.fsf@zenia.red-bean.com> (raw)
In-Reply-To: <3DA3685D.CE1E2E80@redhat.com>


I don't understand the purpose of this patch.

Instead of havingb skip_quoted use gdb_completer_word_break_characters
directly, it adds an argument to skip_quoted, and then passes the
return value from get_gdb_completer_word_break_characters () in every
case.  But the Objective-C case does exactly the same thing as all the
other cases; it doesn't behave any differently.

Is this some sort of preparatory patch for something else?  What's
coming down the line?

Michael Snyder <msnyder@redhat.com> writes:

> 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  <fedor@gnu.org>
> > 
> >         * 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] != '\'')


  reply	other threads:[~2002-10-14 20:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04 19:53 Adam Fedor
2002-10-08 16:22 ` Michael Snyder
2002-10-14 13:47   ` Jim Blandy [this message]
2002-10-14 14:30     ` Michael Snyder
2002-10-14 14:33     ` Klee Dienes
2002-10-16  0:44       ` Jim Blandy
2002-10-16  3:29         ` [PATCH] minor nit in read_tilde_fields Klee Dienes
2002-10-16  6:54           ` Daniel Jacobowitz
2002-10-17 23:33         ` [PATCH] Redefine skip_quoted Adam Fedor
2002-10-18 14:52           ` Elena Zannoni
2002-10-18 15:54             ` Adam Fedor
2002-10-22  8:04               ` Elena Zannoni
2002-10-25 12:43                 ` Adam Fedor
2002-11-03 16:20                   ` Elena Zannoni
2002-11-03 18:54                     ` GDB ObjC plan (was: Re: [PATCH] Redefine skip_quoted) Adam Fedor
2002-11-07 12:36               ` [PATCH] Redefine skip_quoted Jim Blandy
2002-10-14 16:17 Adam Fedor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vt2bs5wu5ks.fsf@zenia.red-bean.com \
    --to=jimb@redhat.com \
    --cc=fedor@doc.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox