[PATCH 1/2] Move the code to execute a cmd_list_element out from execute_command

Marco Barisione mbarisione@undo.io
Mon Oct 5 09:40:19 GMT 2020


On 5 Oct 2020, at 10:08, Andrew Burgess <andrew.burgess@embecosm.com> wrote:
>> gdb/ChangeLog:
>> 
>> 	* gdbcmd.h (execute_cmd_list_command): Add declaration.
>> 	* top.c (execute_command): Move out the code to execute a
>> 	command from a cmd_list_element.
>> 	(execute_cmd_list_command): Add from code originally in
>> 	execute_command.
>> 	* top.h (execute_cmd_list_command): Add declaration.
> 
> Why is execute_cmd_list_command declared twice?  This doesn't feel
> right.

On top of gdbcmd.h there’s this comment:
/* ***DEPRECATED***  The gdblib files must not be calling/using things in any
   of the possible command languages.  If necessary, a hook (that may be
   present or not) must be used and set to the appropriate routine by any
   command language that cares about it.  If you are having to include this
   file you are possibly doing things the old way.  This file will dissapear.
   fnasser@redhat.com    */

This deprecation notice was added 20 years ago in commit
<d318976c46b92e4d8640f1310bb7b6b517c8bcf7>.
I couldn't really work out the details, so I just copied what is currently
done for execute_command, which is declared in two header files:
  $ git grep '\bexecute_command\b' -- '*.h'
  gdbcmd.h:extern void execute_command (const char *, int);
  top.h:extern void execute_command (const char *, int);


-- 
Marco Barisione



More information about the Gdb-patches mailing list