Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: Add language parameter to all parse.c:parse_* functions
@ 2010-05-10 21:53 Joel Brobecker
  2010-05-11 16:44 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2010-05-10 21:53 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-11 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-10 21:53 RFC: Add language parameter to all parse.c:parse_* functions Joel Brobecker
2010-05-11 16:44 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox