This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 12/24] Introduce generic command options framework
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 03 Jun 2019 13:16:24 -0600
- Subject: Re: [PATCH v2 12/24] Introduce generic command options framework
- References: <20190530195333.20448-1-palves@redhat.com> <20190530195333.20448-13-palves@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> This commit adds a generic command options framework, that makes it
Pedro> easy enough to add '-'-style options to commands in a uniform way,
Pedro> instead of each command implementing option parsing in its own way.
This all seems reasonable to me. Thanks for taking this on.
Pedro> +/* Dup STR and return a unique_xmalloc_ptr for the result. */
Pedro> +
Pedro> +static gdb::unique_xmalloc_ptr<char>
Pedro> +make_unique_xstrdup (const char *str)
Pedro> +{
Pedro> + return gdb::unique_xmalloc_ptr<char> (xstrdup (str));
Pedro> +}
I could 25 spots that could use this, so how about putting it into a
header somewhere? I am happy to convert all the existing uses.
Pedro> + if (len > 0 && strncmp ("unlimited", *arg, len) == 0)
I should have mentioned this in an earlier patch, but won't this also
match things like "unlimitedjunk"?
Tom