Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* About remote target AF_UNIX socket addition ?
@ 2009-03-27 14:46 Philippe Waille
  2009-03-27 14:57 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Waille @ 2009-03-27 14:46 UTC (permalink / raw)
  To: gdb

Hello !

  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 */


  Typical usage :
  + a set of users perform debugging on a shared POSIX server
  + each user execute gdb and a target (a processor simulator, for instance),
both on the local server
  + the target stub does not offer the remote pipe connection method,
but allows socket connections.

  Each user has to be allocated a private port name in order to bind its 
gdb with its target. It is easier to do in the AF_UNIX local 
filesystem naming space than in the gloabl TCP/IP port numbering space.


Best regards 
Ph. Waille
  
-- 
-----------------------------------------------------------------------------
Philippe WAILLE                            email :    Philippe.Waille@imag.fr
IMAG ID (Informatique et distribution)       Tel :    04 76 61 20 13
ENSIMAG - antenne de Montbonnot          Foreign :  33 4 76 61 20 13
INOVALLEE					     Fax :    04 76 61 20 99
51, avenue Jean Kuntzmann
38330 MONTBONNOT SAINT MARTIN


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: About remote target AF_UNIX socket addition ?
  2009-03-27 14:46 About remote target AF_UNIX socket addition ? Philippe Waille
@ 2009-03-27 14:57 ` Pedro Alves
  2009-03-27 19:51   ` Philippe Waille
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2009-03-27 14:57 UTC (permalink / raw)
  To: gdb; +Cc: Philippe Waille

On Friday 27 March 2009 14:39:15, Philippe Waille 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 */
> 
> 
>   Typical usage :
>   + a set of users perform debugging on a shared POSIX server
>   + each user execute gdb and a target (a processor simulator, for instance),
> both on the local server
>   + the target stub does not offer the remote pipe connection method,
> but allows socket connections.
> 
>   Each user has to be allocated a private port name in order to bind its 
> gdb with its target. It is easier to do in the AF_UNIX local 
> filesystem naming space than in the gloabl TCP/IP port numbering space.

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

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: About remote target AF_UNIX socket addition ?
  2009-03-27 14:57 ` Pedro Alves
@ 2009-03-27 19:51   ` Philippe Waille
  2009-03-27 20:01     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Waille @ 2009-03-27 19:51 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb, Philippe Waille

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)


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" 

Best regards
Ph. W.

-- 
-----------------------------------------------------------------------------
Philippe WAILLE                            email :    Philippe.Waille@imag.fr
IMAG ID (Informatique et distribution)       Tel :    04 76 61 20 13
ENSIMAG - antenne de Montbonnot          Foreign :  33 4 76 61 20 13
INOVALLEE					     Fax :    04 76 61 20 99
51, avenue Jean Kuntzmann
38330 MONTBONNOT SAINT MARTIN


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: About remote target AF_UNIX socket addition ?
  2009-03-27 19:51   ` Philippe Waille
@ 2009-03-27 20:01     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2009-03-27 20:01 UTC (permalink / raw)
  To: gdb; +Cc: Philippe Waille

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-27 20:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27 14:46 About remote target AF_UNIX socket addition ? Philippe Waille
2009-03-27 14:57 ` Pedro Alves
2009-03-27 19:51   ` Philippe Waille
2009-03-27 20:01     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox