This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] gdbserver: Use std::list for all_dlls
On 2017-10-09 11:33 AM, Pedro Alves wrote:
> On 10/09/2017 04:12 PM, Simon Marchi wrote:
>> As a small step towards removing inferior_list/inferior_list_entry, this
>> patch replaces the usage of inferior_list for the list of dlls by an
>> std::list. The dll_info type now uses an std::string for name and has a
>> simple constructor.
>>
>> I am able to build gdbserver with mingw on Linux, but I am not able to
>> test this on a Windows machine (the only platform that uses this code).
>>
>
> Thanks for the update. This version is fine with me.
>
>>
>> @@ -76,16 +40,20 @@ loaded_dll (const char *name, CORE_ADDR base_addr)
>> void
>> unloaded_dll (const char *name, CORE_ADDR base_addr)
>> {
>> - struct dll_info *dll;
>> - struct dll_info key_dll;
>> + auto pred = [&] (const dll_info &dll) {
>
> FWIW, I've been formatting lambdas like this:
>
> auto pred = [&] (const dll_info &dll)
> {
> if (base_addr != UNSPECIFIED_CORE_ADDR
>
> for_each (..., [&] (const dll_info &dll)
> {
> if (base_addr != UNSPECIFIED_CORE_ADDR
>
> The latter models on:
>
> if (foo)
> {
> if (base_addr != UNSPECIFIED_CORE_ADDR
>
> The former I think from the latter, and because that's
> what emacs+tab wants.
Ok, thanks for the tip. I'll change that in my local branch.
Simon