Re: [PATCH][gdb/testsuite] Reimplement gdb.gdb/python-interrupts.exp as unittest

Tom de Vries via Gdb-patches
2021-10-19T21:57:50Z

On 10/19/21 8:09 PM, Tom Tromey wrote:
> Tom> [gdb/testsuite] Reimplement gdb.gdb/python-interrupts.exp as unittest
>
> Thanks for doing this.
>
> Tom> +#if GDB_SELF_TEST
> Tom> +namespace selftests {
> Tom> +extern void (*hook_set_active_ext_lang) (void);
> Tom> +void (*hook_set_active_ext_lang) (void) = nullptr;
>
> Shouldn't need the "(void)" any more, just "()" should be ok.
>

Done.

> It seems weird that both a declaration and definition are needed.
> I guess it's a compiler issue though.
>

Indeed, some warning, -Wmissing-declarations if I'm not mistaken.

> Tom> #if GDB_SELF_TEST
> Tom> namespace selftests {
>
> Tom> +extern void (*hook_set_active_ext_lang) (void);
>
> I suppose it's hard to stick this declaration somewhere else.
>

I've moved it to gdb/extension.h.

I suppose I usually do this to avoid .h-triggered rebuilds while writing
the patch, and then forget to move it to a proper location.

> Tom> +
> Tom> +static void
> Tom> +raise_sigint (void)
>
> The (void) thing again, though this could also just be a tiny lambda in
> the code as well.

Done, and committed.

Thanks,
- Tom