Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows
@ 2019-03-23 11:59 Владимир Мартьянов
  2019-03-23 13:11 ` Eli Zaretskii
  0 siblings, 1 reply; 23+ messages in thread
From: Владимир Мартьянов @ 2019-03-23 11:59 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

The fourth argument of FormatMessage() in strwinerror() in file
win32-low.c is set to zero. Thus, Windows could use system default
locale to translate error codes to error message. At the same time,
gdbserver have hardcoded English error messages ("Error creating
process..." for example). As a result, server could display error
messages with mixed languages.

I made a patch to use en_US locale in FormatMessage, so all error
messages will be in English.

Changelog and patch files are attached

[-- Attachment #2: Changelog.24377 --]
[-- Type: application/octet-stream, Size: 219 bytes --]

gdb/gdbserver/ChangeLog:
2019-03-23  Vladimir Martyanov  <vilgeforce@gmail.com>

	PR server/24377
	* win32-low.c (strwinerror): Changed system deafult locale to
	en_US when translating Windows error code to message

[-- Attachment #3: 0001-Fix-mixing-English-and-system-default-languages-in-e.patch --]
[-- Type: application/octet-stream, Size: 809 bytes --]

From 1bcfc9bdc14399f04c802ac5e4f4591538b9d2fd Mon Sep 17 00:00:00 2001
From: Vladimir Martyanov <vilgeforce@gmail.com>
Date: Sat, 23 Mar 2019 14:31:33 +0300
Subject: [PATCH] Fix mixing English and system default languages in error
 messages on Windows

---
 gdb/gdbserver/win32-low.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index 1a50141c12..226e0126d8 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -516,7 +516,7 @@ strwinerror (DWORD error)
 			       | FORMAT_MESSAGE_ALLOCATE_BUFFER,
 			       NULL,
 			       error,
-			       0, /* Default language */
+			       MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
 			       (LPTSTR) &msgbuf,
 			       0,
 			       NULL);
-- 
2.16.2.windows.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-04-03 12:04 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-23 11:59 [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows Владимир Мартьянов
2019-03-23 13:11 ` Eli Zaretskii
2019-03-28 20:36   ` Владимир Мартьянов
2019-03-29  8:27     ` Eli Zaretskii
2019-03-29  8:42       ` Владимир Мартьянов
2019-03-29  9:29         ` Eli Zaretskii
2019-03-29  9:39           ` Владимир Мартьянов
2019-03-29 12:32             ` Eli Zaretskii
2019-03-30 21:26               ` Владимир Мартьянов
2019-03-31 14:45                 ` Eli Zaretskii
2019-03-31 19:39                   ` Владимир Мартьянов
2019-04-01  4:47                     ` Eli Zaretskii
2019-04-02 20:08                       ` Владимир Мартьянов
2019-04-03  4:30                         ` Eli Zaretskii
2019-04-01 22:08                     ` Jon Turney
2019-04-02 20:57                       ` Владимир Мартьянов
2019-04-02 21:10                         ` Jon Turney
2019-04-02 21:18                           ` Владимир Мартьянов
2019-04-03  4:48                         ` Eli Zaretskii
2019-04-03  4:58                           ` LRN
2019-04-03  7:37                             ` Eli Zaretskii
2019-04-03 11:32                               ` LRN
2019-04-03 12:04                                 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox