This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/]
- From: Pedro Alves <palves at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: jan dot kratochvil at redhat dot com, brobecker at adacore dot com, yao at codesourcery dot com, gdb-patches at sourceware dot org, ktietz at redhat dot com
- Date: Thu, 18 Dec 2014 17:59:47 +0000
- Subject: Re: [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/]
- Authentication-results: sourceware.org; auth=none
- References: <87a92pvc0w dot fsf at codesourcery dot com> <20141215124358 dot GU5457 at adacore dot com> <20141215171225 dot GA19674 at host2 dot jankratochvil dot net> <20141215181449 dot GA5457 at adacore dot com> <20141215182057 dot GA22226 at host2 dot jankratochvil dot net> <20141215183554 dot GB5457 at adacore dot com> <20141215184014 dot GA22610 at host2 dot jankratochvil dot net> <83y4q8wxk7 dot fsf at gnu dot org> <20141215222801 dot GA28138 at host2 dot jankratochvil dot net> <83vblcw9hw dot fsf at gnu dot org> <20141217191755 dot GE21574 at host2 dot jankratochvil dot net> <83r3vyul89 dot fsf at gnu dot org> <5491E8C4 dot 502 at redhat dot com> <83y4q4ub3q dot fsf at gnu dot org>
On 12/18/2014 05:22 PM, Eli Zaretskii wrote:
>> Date: Wed, 17 Dec 2014 20:34:12 +0000
>> From: Pedro Alves <palves@redhat.com>
>> CC: brobecker@adacore.com, yao@codesourcery.com, gdb-patches@sourceware.org,
>> ktietz@redhat.com
>>
>> Note that set_gdbarch_infcall_mmap doesn't need to implement the
>> whole feature set of mmap. We only need to be able to carve out a
>> piece of memory. Should map trivially to VirtualAlloc.
>
> That's true, but if this feature will work by doing the equivalent of
> dlopen, then it will most probably only ever work on GNU/Linux. Even
> there, we cannot really hope to do all this stuff by hand, do it
> safely, and then track all the changes in the OS to keep this working
> for the years to come. And good luck being able to do it at all on
> proprietary systems such as Windows, where you cannot simply examine
> the sources of the DLL loader.
I don't think we'll need to. In fact, I have a feeling that on Windows
things will tend to be simpler, given PE is simpler/more contained
than ELF. But if it turns out that whoever tries to make this work on
Windows finds out that the LoadLibrary route is better for Windows, then
I don't see that as a problem. I'm sure we can fit that in by overriding
some hooks.
> I conclude that sadly this feature is extremely limited, and will
> probably die very soon, unless we change its implementation to
> something more portable and safe.
We shall see. :-)
Thanks,
Pedro Alves