Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds

Daniel Jacobowitz
2010-03-02T13:54:18Z

On Tue, Mar 02, 2010 at 11:43:58AM +0100, Corinna Vinschen wrote:
> The target specifies charset and wide charset. So we need two
> target-specific variables. As I mentioned above, both variables would
> replace the auto_target...charset variables.

That makes sense.

> How do I access the current gdbarch from show_target_charset_name,
> show_target_wide_charset_name, and all the other functions in charset.c
> which refer to the target charsets?

From the show functions, which are called by the CLI infrastructure, I
think you're supposed to use get_current_arch (in arch-utils.h).

From other functions, mostly, you need the caller to pass an
architecture. An increasing portion of GDB is parameterized
this way. That'll work for e.g. target_wide_charset ().

I don't think you can do either from _initialize_charset. That may
have to happen lazily...

--
Daniel Jacobowitz
CodeSourcery