From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16231 invoked by alias); 27 Mar 2009 20:01:36 -0000 Received: (qmail 15868 invoked by uid 22791); 27 Mar 2009 20:01:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Mar 2009 20:01:31 +0000 Received: (qmail 431 invoked from network); 27 Mar 2009 20:01:29 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Mar 2009 20:01:29 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: About remote target AF_UNIX socket addition ? Date: Fri, 27 Mar 2009 20:01:00 -0000 User-Agent: KMail/1.9.10 Cc: Philippe Waille References: <20090327143915.GA18690@otto.imag.fr> <200903271457.02867.pedro@codesourcery.com> <20090327193901.GA6735@navajo.imag.fr> In-Reply-To: <20090327193901.GA6735@navajo.imag.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903272001.37013.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00184.txt.bz2 On Friday 27 March 2009 19:39:01, Philippe Waille wrote: > On Fri, Mar 27, 2009 at 02:57:02PM +0000, Pedro Alves wrote: > > > The target command allows remote stub access through TCP sockets. > > > Could it be extended to local unix domain (AF_UNIX) sockets as well ? > > > > > > gdb> target remote | some_stub_target /* existing */ > > > gdb> target remote tcp:host:ip_port_number /* existing */ > > > gdb> target remote unix:local_filesystem_port_name /* suggested */ > > > > > I'm not objecting, but, my knee jerk reaction would be to implement a > > netcat/socat-like stub that does stdio <-> unix socket forwarding, so > > you'd use: > > > > target remote | mypipe_to_socket_gateway > > Outside gdb = end user pipe-to-socket-stub : > > a) each gdb user with the same problem will design again a stub > b) multiplex two unidirectionnal streams on a bidirectional socket > c) carefully manage pipe/socket closing > --> not so simple code (I expect poll/select or multithread) Doesn't socat do this already? Wouldn't something like a script that execs socat with the right parameters do? This would mean you'd be able to do this with any version of GDB that supports "target remote |". No C code involved. > Inside gdb : > > I expect a small gdb patch (net_open function in ser-tcp.c and command > line option documentation) : > > a) detect a new af_unix port name prefix string > b) fill/pass a sockaddr_un (instead of sockaddr_in) parameter to connect > --> after connect, reuse the existing tcp code > --> #ifdef "AF_UNIX/AF_LOCAL missing on WINDOWS" As I said, I wasn't objecting. -- Pedro Alves