From: Jon Turney <jon.turney@dronecode.org.uk>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Handle encoding failures in Windows thread names
Date: Thu, 2 Jun 2022 20:29:36 +0100 [thread overview]
Message-ID: <1133f958-06f5-7ece-6202-078cc6d3c8f6@dronecode.org.uk> (raw)
In-Reply-To: <878rqf3zkx.fsf@tromey.com>
On 02/06/2022 15:33, Tom Tromey wrote:
>>>>>> "Jon" == Jon Turney <jon.turney@dronecode.org.uk> writes:
>
> Jon> This is probably wrong on Cygwin (as the target encoding should be
> Jon> Cygwin's conception of the locale, not the Windows codepage).
Here I meant "Cygwin's conception of the locale for the gdb process"
> If there's some way for gdb to know the locale of the inferior, I guess
> we could use that here. I don't have Cygwin and so I can't test it or
> anything, but if I knew what to do I could try to write a patch for
> someone else to test.
I am confused by this, but probably I'm missing something.
GetThreadDescription() only exists as a wide-char API, so the threadname
it returns is always UTF-16 encoded, irrespective of the inferior's locale.
Probably, the "right" thing to do on cygwin is use wcstombs(), but
apparently that can't report the encoding failure condition you want to
detect.
next prev parent reply other threads:[~2022-06-02 19:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 14:39 Tom Tromey
2022-04-21 15:47 ` Eli Zaretskii
2022-04-26 18:53 ` Tom Tromey
2022-06-02 14:19 ` Jon Turney
2022-06-02 14:33 ` Tom Tromey
2022-06-02 19:29 ` Jon Turney [this message]
2022-06-03 16:19 ` Tom Tromey
2022-06-02 16:07 ` Eli Zaretskii
2022-06-02 19:29 ` Jon Turney
2022-06-03 5:28 ` Eli Zaretskii
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=1133f958-06f5-7ece-6202-078cc6d3c8f6@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).