Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Stan Cox <scox@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] add file desc to gdbserver client_state
Date: Fri, 13 Dec 2019 23:13:00 -0000	[thread overview]
Message-ID: <87fthnvmxz.fsf@tromey.com> (raw)
In-Reply-To: <8448b37f-ebdf-d2d9-829a-87f7f6ea102c@redhat.com> (Stan Cox's	message of "Tue, 26 Nov 2019 13:01:23 -0500")

>>>>> "Stan" == Stan Cox <scox@redhat.com> writes:

Stan> This patch adds gdb_fildes_t support to gdbserver for later use by the
Stan> gdbserver multi-client patch.  That patch enables multiple clients
Stan> with each client associated with its corresponding file desc.   This
Stan> patch adds the corresponding file desc to the client_state and adds a
Stan> file desc parameter to the gdbserver I/O ops.  It also adds a minimal
Stan> multi_client_states which currently just manages a single client_state
Stan> but later will be expanded to be a collection of multiple
Stan> client_states where each client_state is the state for an individual
Stan> client.  The gdbserver multi-client patch is mentioned in:
Stan> https://sourceware.org/ml/gdb-patches/2019-08/msg00577.html

Thanks.

This looks like a reasonable first step.  Hopefully a few things will
change in coming patches?  I'll note some below.  Also, I think in
general it needs a few more comments and some formatting cleanup.


Stan> +
Stan> +int
Stan> +get_remote_desc (void)
Stan> +{

In gdb new functions need a comment -- usually a description in the
header and then something like "see mumble.h" at the implementation.

Will remote_desc be going away?  And hopefully get_remote_desc is also
just a stepping stone?

Stan> +  struct multi_client_states & client_states = get_client_states();

Should be "&client_states", without a space.

Stan> +multi_client_states&

"multi_client_states &".

Stan> +get_client_states (void)

No more "(void)" now that we're using C++.  I think there's a few spots
for this.

Stan> +client_state&

"client_state &".

Stan> +multi_client_states::set_client_state (gdb_fildes_t fd)
Stan> +{
Stan> +  client_state &cs = get_client_state ();

Can get_client_state be made static now?
If not, why not?

Stan> +  int remote_desc = get_remote_desc();

"get_remote_desc ()".  But why does this use int while other spots use
gdb_fildes_t?

Stan> --- a/gdb/gdbserver/server.h
Stan> +++ b/gdb/gdbserver/server.h
Stan> @@ -142,6 +142,8 @@ struct client_state
Stan>      own_buf ((char *) xmalloc (PBUFSIZ + 1))
Stan>    {}

Stan> +  gdb_fildes_t file_desc;

Needs a comment.


Stan> -client_state &get_client_state ();
Stan> +struct multi_client_states
Stan> +{
Stan> +public:

Needs a comment.
Probably should say "class" and not "struct", particularly since it's
using "public:".

Stan> +  client_state & set_client_state (gdb_fildes_t);

"&set_client_state".  Needs a comment.

Stan> +client_state & get_client_state ();
Stan> +struct multi_client_states & get_client_states (void);

Extra spaces and lack of comments here too.

Tom


  reply	other threads:[~2019-12-13 23:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 23:30 [PATCH] Don't override various Makefile variables for gnulib et al Christian Biesinger via gdb-patches
2019-11-26 18:01 ` [PATCH] add file desc to gdbserver client_state Stan Cox
2019-12-13 23:13   ` Tom Tromey [this message]
2019-12-24  4:42     ` Stan Cox
2020-01-24 18:21       ` Tom Tromey
2020-02-06 19:41       ` Stan Cox
2020-01-29 14:07 ` [PATCH] Don't override various Makefile variables for gnulib et al Christian Biesinger via gdb-patches
2020-01-29 14:10 ` Christian Biesinger via gdb-patches
2020-02-12 21:16   ` Christian Biesinger via gdb-patches

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=87fthnvmxz.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=scox@redhat.com \
    /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