From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55345 invoked by alias); 7 Sep 2018 21:06:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 55336 invoked by uid 89); 7 Sep 2018 21:06:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=socket, Allow, @item, unify X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.146.7) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Sep 2018 21:06:45 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 5BF786ABD for ; Fri, 7 Sep 2018 16:06:44 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id yNx2fxRU5bXuJyNxSfHE1v; Fri, 07 Sep 2018 16:06:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8LKfJyMJAm1IJCe18kxPgSjTBewffG89gqtpXsF3sXI=; b=JGASXY7YdU7+VCaaXJmYgSZEHk c2JobOgKR3KzjO/ChSsx34VpuiK/CBE2VBuEGQczSGLnoV+f7dKND5+8E6XDc5KZWRoPDPUgnpb28 2ktrdvqao/aemBz1JRJn9X1y1; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:51148 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fyNx2-001hhQ-6i; Fri, 07 Sep 2018 16:06:00 -0500 From: Tom Tromey To: John Darrington Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Allow remote debugging over a Unix local domain socket. References: <20180903121736.5246-1-john@darrington.wattle.id.au> <20180903121736.5246-2-john@darrington.wattle.id.au> Date: Fri, 07 Sep 2018 21:06:00 -0000 In-Reply-To: <20180903121736.5246-2-john@darrington.wattle.id.au> (John Darrington's message of "Mon, 3 Sep 2018 14:17:36 +0200") Message-ID: <87h8j1vwzs.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-09/txt/msg00125.txt.bz2 >>>>> "John" == John Darrington 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