This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Reducing the use of current_language - some patches
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: brobecker at adacore dot com (Joel Brobecker)
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 4 Nov 2007 18:15:00 +0100 (CET)
- Subject: Re: [RFC] Reducing the use of current_language - some patches
Joel Brobecker wrote:
> As I said before, the goal of this exercise is to avoid having to play
> with the current language in order to do parsing operations in a language
> that may not be the current language.
This sounds like a good idea, thanks for taking care of it!
Just one suggestion that occurred to me: parsing operations depend
on further global state than just the current language; in particular
they depend on the "input_radix", and also on the currently active
gdbarch (which e.g. modifies language primitive types).
So I was wondering if we shouldn't add just a "language" parameter
to the parsing routines, but something more general, like a "parse
context" structure. This could encapsulate all that global state,
and would be easily extensible in the future ...
Maybe (if this is a good idea), it could be done after your current
set of patches; on the other hand, as you're touching all those files
anyway, maybe it would be simpler to do it in one go.
What do you think?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com