List Info

Thread: gdbserver using serial port




gdbserver using serial port
country flaguser name
Japan
2007-11-01 21:14:13
Hello, 

I would like to ask you about gdbserver in case of using
serial port.
In gdb-6.6, if I run gdbserver using serial port, the
following messages
continue and it can't establish the connection to host gdb.

% gdbserver /dev/ttyS0 a.out
...
Remote debugging using /dev/ttyS0
readchar: Socket operation on non-socket
Remote side has terminated connection.  GDBserver will
reopen the connection.
Remote debugging using /dev/ttyS0
readchar: Socket operation on non-socket
Remote side has terminated connection.  GDBserver will
reopen the connection.
Remote debugging using /dev/ttyS0
readchar: Socket operation on non-socket
...

And then in gdb-6.7, the following messages are displayed. 

% gdbserver /dev/ttyS0 a.out
Process a.out created; pid = 10696
Remote debugging using /dev/ttyS0

So I ran the host gdb and tried to establish the connection
between host
and target, but couldn't establish the connections channel.

In the both cases, if I use the network as the debug
channel, 
I can use the gdb/gdbserver without any problems.

Do you have any ideas or comments ?

Thank you.

---
Yoriko Komatsuzaki (yorikosm.sony.co.jp)



Re: gdbserver using serial port
country flaguser name
United States
2007-11-01 21:25:18
On Fri, Nov 02, 2007 at 11:14:13AM +0900, Yoriko Komatsuzaki
wrote:
> Hello, 
> 
> I would like to ask you about gdbserver in case of
using serial port.
> In gdb-6.6, if I run gdbserver using serial port, the
following messages
> continue and it can't establish the connection to host
gdb.

Yes, serial support was broken in gdbserver 6.6.

> % gdbserver /dev/ttyS0 a.out
> Process a.out created; pid = 10696
> Remote debugging using /dev/ttyS0
> 
> So I ran the host gdb and tried to establish the
connection between host
> and target, but couldn't establish the connections
channel.

Please be more specific.  What does "set debug serial
1" and "set
debug remote 1" before connecting show?

If your console is /dev/ttyS0 and a.out writes to the
terminal, you
will need to redirect it, or it will interfere with
communication.

-- 
Daniel Jacobowitz
CodeSourcery

Re: gdbserver using serial port
country flaguser name
Japan
2007-11-01 23:11:47
Thank you for your answer.

My environment is a littel special.

On target (gdbserver run), the serial (/dev/ttyS0) is used
as the
channel. But on host (gdb run), the usb (/dev/ttyUSB0) is
used.
And the host and the target is connected by "the
serial/usb
transimission cable". 

So I guess that this special hardware environment might
affects this
problem.

% gdb
(gdb) set debug remote 1
(gdb) set debug serial 1
(gdb) target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
Sending packet: $qSupported#37...


Thank you.
---
Yoriko Komatsuzaki (yorikosm.sony.co.jp)

> On Fri, Nov 02, 2007 at 11:14:13AM +0900, Yoriko
Komatsuzaki wrote:
> > Hello, 
> > 
> > I would like to ask you about gdbserver in case of
using serial port.
> > In gdb-6.6, if I run gdbserver using serial port,
the following messages
> > continue and it can't establish the connection to
host gdb.
> 
> Yes, serial support was broken in gdbserver 6.6.
> 
> > % gdbserver /dev/ttyS0 a.out
> > Process a.out created; pid = 10696
> > Remote debugging using /dev/ttyS0
> > 
> > So I ran the host gdb and tried to establish the
connection between host
> > and target, but couldn't establish the connections
channel.
> 
> Please be more specific.  What does "set debug
serial 1" and "set
> debug remote 1" before connecting show?
> 
> If your console is /dev/ttyS0 and a.out writes to the
terminal, you
> will need to redirect it, or it will interfere with
communication.
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery





Re: gdbserver using serial port
country flaguser name
United States
2007-11-02 06:31:37
On Fri, Nov 02, 2007 at 01:11:47PM +0900, Yoriko Komatsuzaki
wrote:
> 
> Thank you for your answer.
> 
> My environment is a littel special.
> 
> On target (gdbserver run), the serial (/dev/ttyS0) is
used as the
> channel. But on host (gdb run), the usb (/dev/ttyUSB0)
is used.
> And the host and the target is connected by "the
serial/usb
> transimission cable". 
> 
> So I guess that this special hardware environment might
affects this
> problem.
> 
> % gdb
> (gdb) set debug remote 1
> (gdb) set debug serial 1
> (gdb) target remote /dev/ttyUSB0
> Remote debugging using /dev/ttyUSB0
> Sending packet: $qSupported#37...

This looks like either a baud rate problem, or some other
complete
failure of serial support on your host.  GDB can't read even
a single
byte from your target.

-- 
Daniel Jacobowitz
CodeSourcery

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )