Discussion:
[Bug build/23568] New: gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not declared in this scope (MinGW/MSYS)
sizious at gmail dot com
2018-08-24 08:28:10 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

Bug ID: 23568
Summary: gdb/ser-mingw.c: error: 'ERROR_IO_PENDING' was not
declared in this scope (MinGW/MSYS)
Product: gdb
Version: 7.12.1
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: sizious at gmail dot com
Target Milestone: ---

When compiling under the original MSYS/MinGW environment (downloaded from
www.mingw.org, i.e. NOT MinGW-w64/MSYS2, as I need Windows XP support), a
compilation error is thrown from the "gdb/ser-mingw.c" file:

../../gdb-7.12.1/gdb/ser-mingw.c: In function 'int
ser_windows_read_prim(serial*, size_t)':
../../gdb-7.12.1/gdb/ser-mingw.c:346:30: error: 'ERROR_IO_PENDING' was not
declared in this scope
if (GetLastError () != ERROR_IO_PENDING
^~~~~~~~~~~~~~~~
../../gdb-7.12.1/gdb/ser-mingw.c: In function 'int
ser_windows_write_prim(serial*, const void*, size_t)':
../../gdb-7.12.1/gdb/ser-mingw.c:368:30: error: 'ERROR_IO_PENDING' was not
declared in this scope
if (GetLastError () != ERROR_IO_PENDING
^~~~~~~~~~~~~~~~
make[3]: *** [ser-mingw.o] Error 1

Note: The host is "mingw32" and the target is "sh-elf".

PROPOSED CORRECTION:
I solved this bug by adding the following code snippet directly in the
"gdb/ser-mingw.c" file:

#ifndef ERROR_IO_PENDING
// In MinGW (original project, for MinGW-w64 I don't know), this code is
defined in that header file.
#include <winerror.h>
#endif

After that modification, the compilation of gdb-7.12.1 with host "mingw32" and
targetting "sh-elf" is successful.
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-24 03:06:24 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #1 from SiZiOUS <sizious at gmail dot com> ---
Created attachment 11208
--> https://sourceware.org/bugzilla/attachment.cgi?id=11208&action=edit
Fix to allow MinGW/MSYS compilation of gdb-7.12.1
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-24 03:09:42 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #2 from SiZiOUS <sizious at gmail dot com> ---
Comment on attachment 11208
--> https://sourceware.org/bugzilla/attachment.cgi?id=11208
Fix to allow MinGW/MSYS compilation of gdb-7.12.1

--- ser-mingw.c 2017-01-21 13:46:47 +0000
+++ ser-mingw.c.patch 2018-08-24 08:30:27 +0000
@@ -31,6 +31,10 @@

#include "command.h"

+#ifndef ERROR_IO_PENDING
+#include <winerror.h>
+#endif
+
void _initialize_ser_windows (void);

struct ser_windows_state
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-24 08:40:33 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

SiZiOUS <sizious at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #11208|1 |0
is patch| |
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-24 03:10:54 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #3 from SiZiOUS <sizious at gmail dot com> ---
Comment on attachment 11208
--> https://sourceware.org/bugzilla/attachment.cgi?id=11208
Fix to allow MinGW/MSYS compilation of gdb-7.12.1

--- ser-mingw.c 2017-01-21 13:46:47 +0000
+++ ser-mingw.c.patch 2018-08-24 08:30:27 +0000
@@ -31,6 +31,10 @@

#include "command.h"

+#ifndef ERROR_IO_PENDING
+#include <winerror.h>
+#endif
+
void _initialize_ser_windows (void);

struct ser_windows_state
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-24 08:41:59 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

SiZiOUS <sizious at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #11208|0 |1
is obsolete| |

--- Comment #4 from SiZiOUS <sizious at gmail dot com> ---
Created attachment 11209
--> https://sourceware.org/bugzilla/attachment.cgi?id=11209&action=edit
Patch to allow MinGW/MSYS compilation of gdb-7.12.1
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-24 08:45:33 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

SiZiOUS <sizious at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Target| |sh-elf
Host| |mingw32
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-24 08:29:40 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
Thanks for the patch. The gdb project doesn't review patches in
bugzilla; instead they must be sent to the gdb-patches list.
See the contribution checklist for details:
https://sourceware.org/gdb/wiki/ContributionChecklist
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-28 10:12:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #6 from SiZiOUS <sizious at gmail dot com> ---
Thanks for your feedback. I confirm that gdb-7.12.1 is compiling fine under
MSYS/MinGW with this little patch applied. I'll submit the patch to the list as
requested.
--
You are receiving this mail because:
You are on the CC list for the bug.
sizious at gmail dot com
2018-08-28 06:32:23 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #7 from SiZiOUS <sizious at gmail dot com> ---
I just submitted the patch now. I hope I respected all the guidelines of the
list.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-26 11:49:44 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23568

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
What's the status of this?
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...