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
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, gdb-patches at sourceware dot org
- Date: Mon, 9 Oct 2017 16:33:49 +0100
- Subject: Re: [PATCH v2] gdbserver: Use std::list for all_dlls
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D389C04AC6B
- References: <a039dfbd-468b-8a07-3c74-e97388eb629e@redhat.com> <20171009151221.7538-1-simon.marchi@polymtl.ca>
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.
Thanks,
Pedro Alves