This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 23/23] Use gdb_argv_up in Python
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 5 Jun 2017 17:29:00 +0100
- Subject: Re: [RFA 23/23] Use gdb_argv_up in Python
- 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=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 20BE3C04B321
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 20BE3C04B321
- References: <20170503224626.2818-1-tom@tromey.com> <20170503224626.2818-24-tom@tromey.com>
On 05/03/2017 11:46 PM, Tom Tromey wrote:
> This changes one spot in the Python code to use gdb_argv_up. This
> removes the last cleanup from the Python layer.
Hurray! Thanks so much for all this work.
> - self->enumeration[i]
> - = python_string_to_host_string (item.get ()).release ();
> + enumeration[i] = python_string_to_host_string (item.get ()).release ();
> if (self->enumeration[i] == NULL)
I think you need to adjust the if too:
if (enumeration[i] == NULL)
> - {
> - do_cleanups (back_to);
> - return 0;
> - }
> - make_cleanup (xfree, (char *) self->enumeration[i]);
> + return 0;
> }
>
> - discard_cleanups (back_to);
> + self->enumeration = const_cast<const char**> (enumeration.release ());
> return 1;
If I'm reading the code correctly, "self->enumeration" is never
released (by design), right?
Thanks,
Pedro Alves