This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 12/24] Introduce generic command options framework


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]