[PATCH 3/3] gdb: More compile fixes for gnu-nat.c.

Simon Marchi simark@simark.ca
Mon Nov 22 15:17:13 GMT 2021


On 2021-11-22 2:30 a.m., Jan (janneke) Nieuwenhuizen via Gdb wrote:
> This fixes compile errors like
> 
>     ../../gdb-11.1/gdb/gnu-nat.c: In function ‘void add_task_commands()’:
>     ../../gdb-11.1/gdb/gnu-nat.c:3204:17: error: no matching function for call to ‘add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)’
>      3204 |         &setlist);
>           |                 ^
>     In file included from ../../gdb-11.1/gdb/completer.h:21,
>                      from ../../gdb-11.1/gdb/symtab.h:36,
>                      from ../../gdb-11.1/gdb/infrun.h:21,
>                      from ../../gdb-11.1/gdb/target.h:42,
>                      from ../../gdb-11.1/gdb/inf-child.h:23,
>                      from ../../gdb-11.1/gdb/gnu-nat.h:38,
>                      from ../../gdb-11.1/gdb/gnu-nat.c:24:
>     ../../gdb-11.1/gdb/command.h:160:33: note: candidate: ‘cmd_list_element* add_cmd(const char*, command_class, void (*)(const char*, int), const char*, cmd_list_element**)’
>       160 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
>           |                                 ^~~~~~~
>     ../../gdb-11.1/gdb/command.h:161:30: note:   no known conversion for argument 3 from ‘cmd_list_element*’ to ‘void (*)(const char*, int)’
>       161 |       cmd_const_cfunc_ftype *fun,
>           |       ~~~~~~~~~~~~~~~~~~~~~~~^~~
>     ../../gdb-11.1/gdb/command.h:167:33: note: candidate: ‘cmd_list_element* add_cmd(const char*, command_class, const char*, cmd_list_element**)’
>       167 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
>           |                                 ^~~~~~~
>     ../../gdb-11.1/gdb/command.h:167:33: note:   candidate expects 4 arguments, 5 provided
>     ../../gdb-11.1/gdb/gnu-nat.c:3210:18: error: no matching function for call to ‘add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)’
>      3210 |         &showlist);
>           |                  ^

Hi Jan,

I only see patch 3/3, is it normal?  Otherwise, patches should be sent
to the gdb-patches mailing list (same address, just with gdb-patches
instead of gdb).

> * gdb/gnu-nat.c (add_task_commands): Use a fresh variable instead of
> shadowing set_signals_cmd etc.
> (add_thread_commands): Likewise.

Note that we don't use ChangeLogs in gdb/.

Simon


More information about the Gdb mailing list