Re: [RFA v2 3/4] Use std::vector in syscall_catchpoint

Simon Marchi
2017-07-21T20:37:43Z

Hi Tom,

Just a nit in addition to what Sergio pointed out, otherwise LGTM too.

On 2017-07-19 22:32, Tom Tromey wrote:
> @@ -385,23 +355,17 @@ print_recreate_catch_syscall (struct breakpoint
> *b, struct ui_file *fp)
>
> fprintf_unfiltered (fp, "catch syscall");
>
> - if (c->syscalls_to_be_caught)
> + for (int iter : c->syscalls_to_be_caught)
> {
> - int i, iter;
> -
> - for (i = 0;
> - VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
> - i++)
> - {
> - struct syscall s;
> + struct syscall s;
>
> - get_syscall_by_number (gdbarch, iter, &s);
> - if (s.name)
> - fprintf_unfiltered (fp, " %s", s.name);
> - else
> - fprintf_unfiltered (fp, " %d", s.number);
> - }
> + get_syscall_by_number (gdbarch, iter, &s);
> + if (s.name)

Could you add a != NULL while at it?

Thanks,

Simon