Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew <ke@alum.bu.edu>
To: gdb-patches@sourceware.org
Subject: Re: iconv returning byte order marks for Solaris 2.9
Date: Tue, 21 Jul 2009 20:18:00 -0000	[thread overview]
Message-ID: <346309.57700.qm@web33807.mail.mud.yahoo.com> (raw)
In-Reply-To: <m33a8v5e01.fsf@fleche.redhat.com>


Thanks for the patch. I'm actually generating solaris binaries
using a cross compiler (from a Linux box) and in my current 
configuration it doesn't work. __STDC_ISO_10646__ is not defined.

I will try installing gcc locally and see how that works.

Andrew

--- On Fri, 7/17/09, Tom Tromey <tromey@redhat.com> wrote:

> From: Tom Tromey <tromey@redhat.com>
> Subject: Re: iconv returning byte order marks for Solaris 2.9
> To: ke@alum.bu.edu
> Cc: gdb-patches@sourceware.org
> Date: Friday, July 17, 2009, 3:02 PM
> >>>>> "Andrew" ==
> Andrew  <ke@alum.bu.edu>
> writes:
> 
> Andrew> In the system I'm working iconv_open doesn't
> accept "wchar_t" as
> Andrew> encoding name. It failed when
> INTERMEDIATE_ENCODING was set to
> Andrew> that.
> 
> Ah, thanks.
> 
> Andrew> But setting INTERMEDIATE_ENCODING to "UCS-4BE"
> eliminated the
> Andrew> BOM in the beginning.
> 
> Great.  Could you try the appended patch?
> I'm testing it on Linux.
> 
> Tom
> 
> diff --git a/gdb/gdb_wchar.h b/gdb/gdb_wchar.h
> index 07a6c87..241e051 100644
> --- a/gdb/gdb_wchar.h
> +++ b/gdb/gdb_wchar.h
> @@ -35,8 +35,6 @@
>     wrappers for the wchar_t functionality we
> use.  */
>  
>  
> -#define INTERMEDIATE_ENCODING "wchar_t"
> -
>  #if defined (HAVE_ICONV)
>  #include <iconv.h>
>  #else
> @@ -63,6 +61,20 @@ typedef wint_t gdb_wint_t;
>  
>  #define LCST(X) L ## X
>  
> +#ifdef __STDC_ISO_10646__
> +/* On Solaris 9, iconv_open does not accept
> "wchar_t".  So, on this
> +   platform, and other platforms where
> wchar_t is known to use
> +   ISO-10646, choose an appropriate
> explicit charset name.  Also,
> +   UCS-4 on Solaris will emit a BOM, which
> we don't want.  So, we
> +   choose an explicit little- or big-endian
> variant, depending on the
> +   host.  */
> +#if WORDS_BIGENDIAN
> +#define INTERMEDIATE_ENCODING "UCS-4BE"
> +#else
> +#define INTERMEDIATE_ENCODING "UCS-4LE"
> +#endif
> +#endif
> +
>  #else
>  
>  typedef char gdb_wchar_t;
> @@ -87,4 +99,8 @@ typedef int gdb_wint_t;
>  
>  #endif
>  
> +#ifndef INTERMEDIATE_ENCODING
> +#define INTERMEDIATE_ENCODING "wchar_t"
> +#endif
> +
>  #endif /* GDB_WCHAR_H */
> 




  reply	other threads:[~2009-07-21 18:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 18:28 Andrew
2009-07-15 18:57 ` Tom Tromey
2009-07-16  2:29   ` Andrew
2009-07-17 19:19     ` Tom Tromey
2009-07-21 20:18       ` Andrew [this message]
2009-07-24 21:58         ` Tom Tromey
2009-08-14 20:13         ` 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=346309.57700.qm@web33807.mail.mud.yahoo.com \
    --to=ke@alum.bu.edu \
    --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