Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tromey@adacore.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: [pushed] Remove WinCE code from gdbreplay
Date: Tue, 13 Apr 2021 22:20:25 +0100	[thread overview]
Message-ID: <8be268b4-14dd-23ba-bab2-a32d5e20abd2@palves.net> (raw)
In-Reply-To: <912a95eb-0473-cf7d-19bb-157bedb158a6@palves.net>

On 13/04/21 22:14, Pedro Alves wrote:
> On 13/04/21 20:29, Tom Tromey wrote:
>>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>> Simon> The support for WinCE was removed with commit 84b300de3666 ("gdbserver:
>> Simon> remove support for ARM/WinCE").  There is some leftover code for WinCE
>> Simon> support, guarded by the _WIN32_WCE macro, which I didn't know of at the
>> Simon> time.
>>
>> I found one more spot, let me know what you think of the appended.
> 
> OK.  Obvious, even.
> 

I remembered to grep for MINGW32CE, and found some more in gdbreplay.  I've pushed this.

From 6cacd44948d844b035b359a3d65f575c9d7d7aed Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Mon, 12 Apr 2021 20:23:54 +0100
Subject: [PATCH] Remove WinCE code from gdbreplay

gdbserver/ChangeLog:

	* gdbreplay.c [__MINGW32CE__] (COUNTOF, errno, strerror): Remove.
---
 gdbserver/ChangeLog    |  4 ++++
 gdbserver/gdbreplay.cc | 51 ------------------------------------------
 2 files changed, 4 insertions(+), 51 deletions(-)

diff --git a/gdbserver/gdbreplay.cc b/gdbserver/gdbreplay.cc
index 864a31e58f7..3705e9bf45f 100644
--- a/gdbserver/gdbreplay.cc
+++ b/gdbserver/gdbreplay.cc
@@ -69,57 +69,6 @@ typedef int socklen_t;
 static int remote_desc_in;
 static int remote_desc_out;
 
-#ifdef __MINGW32CE__
-
-#ifndef COUNTOF
-#define COUNTOF(STR) (sizeof (STR) / sizeof ((STR)[0]))
-#endif
-
-#define errno (GetLastError ())
-
-char *
-strerror (DWORD error)
-{
-  static char buf[1024];
-  WCHAR *msgbuf;
-  DWORD lasterr = GetLastError ();
-  DWORD chars = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM
-				| FORMAT_MESSAGE_ALLOCATE_BUFFER,
-				NULL,
-				error,
-				0, /* Default language */
-				(LPVOID)&msgbuf,
-				0,
-				NULL);
-  if (chars != 0)
-    {
-      /* If there is an \r\n appended, zap it.  */
-      if (chars >= 2
-	  && msgbuf[chars - 2] == '\r'
-	  && msgbuf[chars - 1] == '\n')
-	{
-	  chars -= 2;
-	  msgbuf[chars] = 0;
-	}
-
-      if (chars > ((COUNTOF (buf)) - 1))
-	{
-	  chars = COUNTOF (buf) - 1;
-	  msgbuf [chars] = 0;
-	}
-
-      wcstombs (buf, msgbuf, chars + 1);
-      LocalFree (msgbuf);
-    }
-  else
-    sprintf (buf, "unknown win32 error (%ld)", error);
-
-  SetLastError (lasterr);
-  return buf;
-}
-
-#endif /* __MINGW32CE__ */
-
 static void
 sync_error (FILE *fp, const char *desc, int expect, int got)
 {

base-commit: 1228cb9094f17c3b151bcb087dcdf2c1cb05ae13
-- 
2.26.2


      reply	other threads:[~2021-04-13 21:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10 23:10 [PATCH] gdb, gdbserver: remove WinCE support code Simon Marchi via Gdb-patches
2021-04-12 11:42 ` Pedro Alves
2021-04-12 15:12   ` Simon Marchi via Gdb-patches
2021-04-12 15:24     ` Simon Marchi via Gdb-patches
2021-04-12 22:20       ` [PATCH] Remove process_stratum_target::hostio_last_error abstraction (Re: [PATCH] gdb, gdbserver: remove WinCE support code) Pedro Alves
2021-04-12 22:52         ` Pedro Alves
2021-04-12 23:56         ` Simon Marchi via Gdb-patches
2021-04-13 13:12           ` Pedro Alves
2021-04-12 13:57 ` [PATCH] gdb, gdbserver: remove WinCE support code Luis Machado via Gdb-patches
2021-04-12 14:01   ` Simon Marchi via Gdb-patches
2021-04-12 14:07     ` Luis Machado via Gdb-patches
2021-04-13 19:29 ` Tom Tromey
2021-04-13 21:14   ` Pedro Alves
2021-04-13 21:20     ` Pedro Alves [this message]

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=8be268b4-14dd-23ba-bab2-a32d5e20abd2@palves.net \
    --to=pedro@palves.net \
    --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