[PATCH 0/3] More cleanup elimination / gdb::unique_ptr

Pedro Alves palves@redhat.com
Mon Oct 17 14:59:00 GMT 2016


On 10/17/2016 03:05 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> 
> Pedro> But I'll be happy to drop my patch instead if you'd prefer.
> 
> No, please keep it.

OK.

>>> but note mine deletes the do_cleanups, which you don't want to do.
> 
> Pedro> Looks like the last cleanup is this one:
> Pedro>       name = xstrdup (TYPE_FIELD_NAME (type, 0));
> Pedro>       cleanup = make_cleanup (xfree, name);
> Pedro>       tail = name + strlen (RUST_ENUM_PREFIX);
> Pedro> and, I can't figure out why we need to xstrdup at all here?
> 
> The string is modified using strtok_r below.

Ah, indeed.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list