From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] gdbserver: Use std::list for all_dlls
Date: Mon, 09 Oct 2017 14:49:00 -0000 [thread overview]
Message-ID: <81d9eff8-140f-dce2-3689-f7c355ff7c11@polymtl.ca> (raw)
In-Reply-To: <a039dfbd-468b-8a07-3c74-e97388eb629e@redhat.com>
On 2017-10-09 10:44 AM, Pedro Alves wrote:
> On 10/09/2017 03:30 PM, Simon Marchi wrote:
>
>> diff --git a/gdb/gdbserver/dll.h b/gdb/gdbserver/dll.h
>> index 39e5eb0653..52f924bc85 100644
>> --- a/gdb/gdbserver/dll.h
>> +++ b/gdb/gdbserver/dll.h
>> @@ -18,17 +18,15 @@
>> #ifndef DLL_H
>> #define DLL_H
>>
>> +#include <list>
>> +
>> struct dll_info
>> {
>> - /* This must appear first. See inferiors.h.
>> - The list iterator functions assume it. */
>> - struct inferior_list_entry entry;
>> -
>> char *name;
>> CORE_ADDR base_addr;
>> };
>>
>> -extern struct inferior_list all_dlls;
>> +extern std::list<dll_info *> all_dlls;
>
> Is there a reason for making this a list of dll_info pointers
> instead of a list of dll_info objects? If you make this a list of
> objects, then each list node + dll_info is allocated in one go,
> very much like the current code. With a list of pointers, you
> have an extra allocation/indirection for each dll_info (one for
> node + pointer, another for the dll_info pointee).
No reason, except that I thought this was a reasonnable intermediary step.
I'll try doing as you say, it's probably not too long.
Simon
next prev parent reply other threads:[~2017-10-09 14:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 14:30 [PATCH 0/3] Get rid of inferior_list Simon Marchi
2017-10-09 14:30 ` [PATCH 1/3] gdbserver: Use std::list for all_dlls Simon Marchi
2017-10-09 14:44 ` Pedro Alves
2017-10-09 14:49 ` Simon Marchi [this message]
2017-10-09 15:12 ` [PATCH v2] " Simon Marchi
2017-10-09 15:33 ` Pedro Alves
2017-10-09 15:46 ` Simon Marchi
2017-10-09 14:30 ` [PATCH 2/3] gdbserver: Use std::list for all_processes Simon Marchi
2017-10-09 14:30 ` [PATCH 3/3] gdbserver: use std::list for all_threads Simon Marchi
2017-10-14 13:12 ` [PATCH 0/3] Get rid of inferior_list Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81d9eff8-140f-dce2-3689-f7c355ff7c11@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox