Re: Building today's snapshot of GDB with MinGW

Simon Marchi
2020-06-30T22:24:28Z

On 2020-06-30 10:09 a.m., Eli Zaretskii wrote:
>>> 4. Running "maint selftests" produces several warnings and failures:
>>>
>>> warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x86-64 settings.
>>
>> Possibly related to
>> https://sourceware.org/pipermail/gdb-patches/2020-March/166678.html ?
>
> Simon, any chance you could look into this, or instruct me how to
> investigate?

I built a GDB on Linux with a MinGW target and ran the self tests. I got:

warning: A handler for the OS ABI "Windows" is not built into this configuration
of GDB. Attempting to continue with the default i386:x64-32 settings.

warning: A handler for the OS ABI "Windows" is not built into this configuration
of GDB. Attempting to continue with the default i8086 settings.

warning: A handler for the OS ABI "Windows" is not built into this configuration
of GDB. Attempting to continue with the default i386:x64-32:intel settings.

These are pretty much expected. For the "gdbarch selftests", we run some test using
all the arches known to BFD. When initializing the gdbarch for these architectures,
the default osabi for that version of GDB is assumed (in gdbarch_info_fill). In your
GDB or the GDB I compiled, the default osabi is Windows.

When trying to initialize that gdbarch, GDB just complains that it doesn't have support
for debugging Windows programs running on i386:x64-32, i386:x64-32:intel and i8086. This
is expected, as i386:x64-32 is an ABI not supported by Windows. And I presume i8086 is
the very old Intel architecture, which obviously does not support Windows.

However, some of the warnings you get are not expected:

warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x86-64 settings.
warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x64-32 settings.
warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i8086 settings.
warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x86-64:intel settings.
warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x64-32:intel settings.
warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x86-64:nacl settings.
warning: A handler for the OS ABI "Windows" is not built into this configuration of GDB. Attempting to continue with the default i386:x64-32:nacl settings.

We would not expect GDB to complain for Windows on i386:x86-64.

The first thing I would do is make sure that the function _initialize_amd64_windows_tdep
gets executed at startup in your GDB. This is the function that registers a handler for
the tuple (i386:x86-64, Windows).

Simon