This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/8] Use class to manage BFD reference counts
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 13 Dec 2016 06:25:50 -0700
- Subject: Re: [RFA 2/8] Use class to manage BFD reference counts
- Authentication-results: sourceware.org; auth=none
- References: <1480395946-10924-1-git-send-email-tom@tromey.com> <1480395946-10924-3-git-send-email-tom@tromey.com> <cce47d1e-b2e2-dcdf-5c36-b318ed1c77db@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> - return NULL;
>> + return gdb_bfd_ref_ptr ();
Pedro> This provides a good reason to have an implicit construction from
Pedro> nullptr_t. You had it in the original gdbpy_reference
Pedro> submission, but I had asked to remove it. If we add it back,
Pedro> these cases could be more clearly written as "return
Pedro> NULL/nullptr". Could you do that, and then drop all the hunks
Pedro> like:
>> - return NULL;
>> + return gdb_bfd_ref_ptr ();
Pedro> ?
I did this.
Pedro> I think these could be:
Pedro> std::string filename
Pedro> = string_printf ("%.*s", filename_len, pathname);
Pedro> std::string member_name
Pedro> = string_printf ("%.*s", path_len - filename_len - 2, sep + 1));
I did this, but it's a bit ugly as solib_find isn't const-correct.
I'll send a new patch soon.
Tom