Re: [PATCHv3 0/3] Remove some uses of VEC

Simon Marchi
2019-09-26T02:52:55Z

On 2019-09-25 7:59 p.m., Andrew Burgess wrote:
> Tom raised some good points about patch #3, specifically that some of
> the query functions like VEC_length and VEC_empty will return a sane
> answer even when the vector pointer is NULL. He also pointed out that
> VEC_free resets theh vector pointer back to NULL.
>
> This revision of the series is a little more defensive about checking
> for the std::vector pointer being null before dereferencing it. In
> places where I'm reasonably sure the vector pointer won't be NULL I've
> added an assert - then at least if I'm wrong we'll get a nice error
> rather than a random crash.

Oh, that's a good point. I gave a quick look at patches 1 and 2, and
they seem good with the extra checks.

About testing, the testsuite contains a bunch of btrace tests in gdb.btrace,
and some more in gdb.python. It would be good to run those tests on a CPU
that supports Intel BTS and PT (which would mean any Broadwell or more recent
CPU) and a GDB linked against libipt. I can give it a try if you are unable
to do it for some reason.

Simon