Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFC] Word break characters are language dependent
Date: Thu, 18 Sep 2003 19:16:00 -0000	[thread overview]
Message-ID: <20030918191641.GY15984@gnat.com> (raw)

Hello,

I was working on implementing proper completion for Ada in GDB, and
ended up reading this part of the code (completer.c:localtion_completer()):

      else if (strchr (gdb_completer_word_break_characters, *p))
        symbol_start = p + 1;

Unfortunately, the word-break characters for Ada are not exactly the
same as the ones used by default.  As a consequence, the current
completer does not always find the correct starting location of the
symbol name.  So I think we should make them language-dependent by
adding a new field to the language vector.

For instance, we could add a new pointer to a function that would
return the string of word-break characters.

My proposal is the following:

  - Add the following field to struct language_defn:

    char * (*la_word_break_characters) (const char *);

  - Move static char *gdb_completer_word_break_characters and
    get_gdb_completer_word_break_characters() to language.[hc]
    and call them: default_completer_word_break_characters
    and get_default_completer_word_break_characters() respectively.

  - Initialize the new field inside all languages to this
    default function.

  - Update completer.c to use the language-dependent version
    of this string, rather than the current hard-coded one.

Sounds reasonable?

Also, while we are looking at this, would it be worth considering
the same for 
  - gdb_completer_command_word_break_characters: I don't think so.
    Command names are independent of the language.
  - gdb_completer_file_name_break_characters: I don't think so either.
    Independent from the filename.
  - gdb_completer_loc_break_characters: Likewise.
  - gdb_completer_quote_characters: This is less obvious. Maybe some
    future language will want to have it's own different quote character.
    Not obvious, so I would leave it as is too.

Thanks,
-- 
Joel


             reply	other threads:[~2003-09-18 19:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-18 19:16 Joel Brobecker [this message]
2003-09-21 12:32 ` Eli Zaretskii
2003-09-21 21:43   ` Joel Brobecker
2003-09-22  5:14     ` Eli Zaretskii
2003-09-23 18:35       ` Joel Brobecker
2003-09-24  5:34         ` Eli Zaretskii
2003-09-24 18:13           ` Joel Brobecker
2003-09-22  7:24     ` Andrew Cagney

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=20030918191641.GY15984@gnat.com \
    --to=brobecker@gnat.com \
    --cc=gdb-patches@sources.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