Re: [RFA] nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing

Eli Zaretskii
2013-12-12T18:51:01Z

> Date: Thu, 12 Dec 2013 19:18:43 +0100
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> On top of that patch, I was able to implement the same post-init
> trick of looking for ntdll.dll, but not without a couple of surprises:
> we don't have FILENAME_CMP nor a "basename" function in gdbserver
> at the moment. I worked around the first issue by using strcasecmp,
> which is good enough for our purposes. But for the second issue,
> I only had a handful of bad options for our current situation:
> 1. Import the module from gnulib; but that's never an innocent
> change, and also the documentation says that it does not work
> for Windows paths;
> 2. Import the libiberty module by hand, which itself depends on
> their safe-ctype.h module.
> 3. Write a quick ad hoc function that implements basename.
>
> (1) is a non-starter, and I didn't like either of (2) or (3).
> In the end, I went for (2) as the quickest option towards testing
> the change and sending an RFC patch. Should we go with this approach,
> we'll probably want to add the libiberty dependencies through
> configure.srv instead of inside OBS. That addition should be
> temporary, as the minute we stop looking specifically for ntdll,
> and load all mapped dlls through that loop, we'll stop needing
> lbasename, and will be able to remove the dependency.

I don't understand why you didn't like (2), I think that's the obvious
choice here.