From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Marco Barisione <mbarisione@undo.io>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Move the code to execute a cmd_list_element out from execute_command
Date: Mon, 5 Oct 2020 18:49:36 +0100 [thread overview]
Message-ID: <20201005174936.GH605036@embecosm.com> (raw)
In-Reply-To: <B2FEF27B-8F94-4225-8EFC-074A1A2E763A@undo.io>
* Marco Barisione <mbarisione@undo.io> [2020-10-05 10:40:19 +0100]:
> 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 */
I read this a couple of times and it still doesn't really make much
sense to me.
Maybe someone else on the list will jump in to explain what's going on
here, but assuming they don't I think we should ignore that comment
and make sure the new code we add is as sane as possible.
To that end I think we should have a single declaration, probably in
gdbcmd.h (as the new function seems related to handling gdb commands)
then fix the build fallout, I only had to add new includes to 'top.c'
and 'cli/cli-script.c' so it isn't huge.
One reason for this, which I completely forgot to mention in my first
reply, is that functions should be documented in the header file, and
in the source file just say '/* See gdbcmd.h. */'. Obviously we
don't want to have functions documented twice at the two declaration
points.
Thanks,
Andrew
>
> 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
>
next prev parent reply other threads:[~2020-10-05 17:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 9:39 Add a way to invoke redefined (overridden) GDB commands Marco Barisione
2020-09-14 9:39 ` [PATCH 1/2] Move the code to execute a cmd_list_element out from execute_command Marco Barisione
2020-10-05 9:08 ` Andrew Burgess
2020-10-05 9:40 ` Marco Barisione
2020-10-05 17:49 ` Andrew Burgess [this message]
2020-09-14 9:39 ` [PATCH 2/2] Add a way to preserve redefined GDB commands for later invocation Marco Barisione
2020-09-14 16:18 ` Eli Zaretskii
2020-09-14 16:51 ` Marco Barisione
2020-10-05 10:24 ` Andrew Burgess
2020-10-05 11:44 ` Marco Barisione
2020-10-05 18:11 ` Andrew Burgess
2020-10-06 7:18 ` Marco Barisione
2020-09-28 7:54 ` [PING] Add a way to invoke redefined (overridden) GDB commands Marco Barisione
2020-10-05 7:42 ` Marco Barisione
2020-10-12 11:50 ` Pedro Alves
2020-10-19 17:41 ` Marco Barisione
2020-10-19 18:05 ` Pedro Alves
2020-10-19 18:47 ` Philippe Waroquiers via Gdb-patches
2020-10-19 19:28 ` Marco Barisione
2020-10-20 15:06 ` Pedro Alves
2020-10-20 18:19 ` Marco Barisione
2020-10-20 18:32 ` Pedro Alves
2020-10-20 15:15 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201005174936.GH605036@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=mbarisione@undo.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox