Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: RFC: Add language parameter to all parse.c:parse_* functions
Date: Mon, 10 May 2010 21:53:00 -0000	[thread overview]
Message-ID: <20100510215347.GI2957@adacore.com> (raw)

This is a followup to:

    http://www.sourceware.org/ml/gdb-patches/2010-05/msg00221.html

I think we all agree that depending on the current_language global to
determine which language parser to use is bad.

As a first step, we need to add language parameter to the parse
routines in parse.c.  Here is how I will do this, if that's OK with
everyone: I will add the new parameter, and then review each caller
trying to determine if there is an obvious language we can use.
Otherwise, I will use current_language as the parameter.

Normally, this should at worst keep things as they are today (ie:
the current_language gets used).  But we would then stop relying
on this global inside that unit.  We can then try to reduce the number
of uses of current_language wherever appropiate based on necessity
(when one finds a bug or works on the code).  Any objection?

Also: We have various parse routines declared in other modules,
most notably eval.c:parse_and_eval*.  It's unclear whether they also
need to be updated to take a language argument - each function probably
needs to be reviewed individually. For instance "parse_and_eval" most
likely need to take a language as an argument, but it's less clear for
parse_and_eval_address (I think it would be better to, since an Ada
user might write an address as 16#deadbeef#).  I propose to deal with
that as a separate patch.

-- 
Joel


             reply	other threads:[~2010-05-10 21:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 21:53 Joel Brobecker [this message]
2010-05-11 16:44 ` Tom Tromey

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=20100510215347.GI2957@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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