Re: [PATCHv2 3/3] gdb: Remove a use of VEC from dwarf2read.{c,h}

Tom Tromey
2019-09-25T22:08:32Z

>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> Removes a use of VEC from dwarf2read.{c,h} and replaces it with
Andrew> std::vector. As far as possible this is a like for like replacement
Andrew> with minimal refactoring.

Andrew> + if (tu_group->tus == nullptr)
Andrew> + tu_group->tus = new std::vector <signatured_type *>;
Andrew> + tu_group->tus->push_back (sig_type);

Andrew> + int len = tu_group->tus->size ();

Is it possible to reach here with tus==nullptr?

Andrew> + for (i = 0; i < tu_group->tus->size (); ++i)

Likewise.

Andrew> - VEC_free (sig_type_ptr, tu_group->tus);
Andrew> + delete tu_group->tus;

VEC_free resets tus to nullptr, but I don't know whether or not that's
important.

Tom