Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: John Darrington <john@darrington.wattle.id.au>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Allow remote debugging over a Unix local domain socket.
Date: Fri, 07 Sep 2018 21:06:00 -0000	[thread overview]
Message-ID: <87h8j1vwzs.fsf@tromey.com> (raw)
In-Reply-To: <20180903121736.5246-2-john@darrington.wattle.id.au> (John	Darrington's message of "Mon, 3 Sep 2018 14:17:36 +0200")

>>>>> "John" == John Darrington <john@darrington.wattle.id.au> writes:

John> Extend the "target remote" and "target extended-remote" commands
John> such that if the filename provided is a Unix local domain (AF_UNIX)
John> socket, then it'll be treated as such, instead of trying to open
John> it as if it were a character device.

I think Pedro should have the final review on this, since he had more
comments the last time around.

John> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
John> index 5068c0ac81..dae62c1787 100644
John> --- a/gdb/doc/gdb.texinfo
John> +++ b/gdb/doc/gdb.texinfo
John> @@ -20703,7 +20703,8 @@ programs.
 
John>  @code{target} command.
 
John> +
John> +@item target remote @var{local-socket}
John> +@itemx target extended-remote @var{local-socket}

That looked like one extra newline in there to me.

John> +#ifndef UNIX_MAX_PATH
John> +# define UNIX_MAX_PATH 108
John> +#endif

As mentioned before, use the sizeof thing.
Now that there are 3 copies of this in gdb, it would be good to unify
them somewhere in common/.

I see:

./gdbserver/tracepoint.c6861:#define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path)
./common/agent.c131:#define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path)

The linux unix(7) man page has some stuff to say about the sizes.

In another message you said:

John> I thought posix required a minimum of 108.

I don't know, but if other platforms do it differently, then gdb has to
adapt to them and not just go by POSIX.

One alternative in these cases is to see if there is a gnulib module we
could use.

thanks,
Tom


  reply	other threads:[~2018-09-07 21:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 12:17 Another version for review John Darrington
2018-09-03 12:17 ` [PATCH] Allow remote debugging over a Unix local domain socket John Darrington
2018-09-07 21:06   ` Tom Tromey [this message]
2018-09-08  4:22     ` John Darrington
2018-09-11  5:20       ` John Darrington
2018-09-11  5:22         ` Tom Tromey
2018-09-11  9:35           ` Pedro Alves
2018-10-01 18:12           ` John Darrington
2018-10-01 18:25             ` Pedro Alves
2018-09-05 15:27 Local domain sockets (take 3) John Darrington
2018-09-05 15:27 ` [PATCH] Allow remote debugging over a Unix local domain socket John Darrington
2018-09-23  4:58   ` John Darrington
2018-09-23  6:01     ` Eli Zaretskii
2018-10-01 20:02   ` 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=87h8j1vwzs.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=john@darrington.wattle.id.au \
    /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