This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Teach GDB that wchar_t is a built-in type in C++ mode
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 31 Mar 2017 11:47:43 +0100
- Subject: Re: [PATCH 2/2] Teach GDB that wchar_t is a built-in type in C++ mode
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A15213DBF7
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A15213DBF7
- References: <1490895288-3854-1-git-send-email-palves@redhat.com> <1490895288-3854-3-git-send-email-palves@redhat.com>
On 03/30/2017 06:34 PM, Pedro Alves wrote:
> Unlike char16_t/char32_t, unfortunately, the underlying type of
> wchar_t is implementation dependent, both size and signness. So this
> requires adding a couple new gdbarch hooks.
>
> Looking at the GCC code base, it seems to me that the majority of the
> ABIs have a 4-byte signed wchar_t, so that's what I made the default
> for GDB too.
>
> I know that Windows has a 16-bit unsigned type wchar_t, so I taught
> GDB about that too.
>
> I didn't bother with doing a compreensive cross check for all the
> ports that would need tweaking, on grounds that this doesn't really
> affect all that much that I'm aware of (I'm mainly doing this for
> completeness). If it does, and the new test doesn't expose it, then
> we can take that as the testsuite needing improvement.
Bah, I hate leaving a job half done. I've cross-checked the types
against GCC now, and adjusted all ports in GDB accordingly. I'll send a
v2 shortly.
Thanks,
Pedro Alves