From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12903 invoked by alias); 4 Jul 2002 22:01:28 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12895 invoked from network); 4 Jul 2002 22:01:27 -0000 Received: from unknown (HELO mailhost.iprg.nokia.com) (205.226.5.12) by sources.redhat.com with SMTP; 4 Jul 2002 22:01:27 -0000 Received: from darkstar.iprg.nokia.com (darkstar.iprg.nokia.com [205.226.5.69]) by mailhost.iprg.nokia.com (8.9.3/8.9.3-GLGS) with ESMTP id PAA04063; Thu, 4 Jul 2002 15:01:26 -0700 (PDT) Received: (from root@localhost) by darkstar.iprg.nokia.com (8.11.0/8.11.0-DARKSTAR) id g64M1Oh28516; Thu, 4 Jul 2002 15:01:24 -0700 X-mProtect: <200207042201> Nokia Silicon Valley Messaging Protection Received: from UNKNOWN (172.19.68.218, claiming to be "gkong.iprg.nokia.com") by darkstar.iprg.nokia.com smtpdKqdzuP; Thu, 04 Jul 2002 15:01:22 PDT Message-Id: <5.1.0.14.1.20020704143746.00a31320@mailhost.iprg.nokia.com> X-Sender: gkong@mailhost.iprg.nokia.com Date: Thu, 04 Jul 2002 15:01:00 -0000 To: Quality Quorum From: "KONG, Gangfeng" Subject: Re: Remote target behind console server Cc: Daniel Jacobowitz , Andrew Cagney , In-Reply-To: References: <5.1.0.14.1.20020703182312.028e9410@mailhost.iprg.nokia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2002-07/txt/msg00053.txt.bz2 At 12:33 AM 7/4/2002 -0400, Quality Quorum wrote: >On Wed, 3 Jul 2002, KONG, Gangfeng wrote: > > > > > > > > > > > Hi, > > > > > > > > I start the gdb stub on the target by: > > > > gdbstart -s 38400 -t /dev/ttyS0 > > > > and start the gdb on the development box by: > > > > gdb vmlinux > > > > gdb) > > > > gdb) set remotebaud 38400 > > > > gdb) target remote my-server-ipaddr:port #note, the port > I put > > > > here is the serial port# on the server, > > > > #not L4 port, correct? > > > > > >No, you have to use telnet port here. > > > > Hi, > > > > normally, I use the command: > > telent server-ipaddr 2001 > > to access its port 1. (2002 for port 2, 2003 for port 3 ...) > > > > It looks like console server already map its L4 port into serial port. > >I suppose that L4 means port 4 on the server and /dev/ttyS0 on the target >then you have to use 'target server-ipaddr 2004'. In fact, L4 port, I mean Layer 4 (transport layer) port. Sorry for the confusion. I am very sure I was assigned at port 1. And I use 'telnet server-ipaddr 2001' to access the target console normally., >If L4 means something else, then use another port. > > >How to debug a connection: > >1. Make sure that terminal server is properly configured and the > cable is good: connect port 4 on the terminal server to the some known > working target, e.g. standar UNIX serial port, do 'telnet server-ip > 2004' and type stuff on console and check responses. > >2. Make sure that gdb stub is workin properly: connect port 4 on the > terminal server to debug port on the targe, start gdb stub, again do > 'telnet server-ip 2004' and make sure that by hitting return you > cause gdb to send you properly formed packets. > >3. Start gdb and do 'target remote server-ip:2004' I would be very > surprised if it does not work at the point. > In order to check the whole system, I did install a kgdb stub of linux on my laptop, so that I can move it around. What I have done are: 1. enable the /dev/ttyS0 in /etc/inittab, then I can login through serial port the check whether it works. I connect it to the port 1 of my console server, then, I remotely login into it by 'telnet server-ipaddr 2001'. Works! SO: - target serial port works - console server works 2. I move the laptop target close to my development box, and I use serial cable to connect them directly. I start the stub on target by 'gdbstart -s 38400 -t /dev/ttyS0'. And then start the gdb on the development box. Now I can use gdb to debug my target box as expected. SO: - the stub on target is ok - the gdb on the development box is ok 3. Now I move the laptop target back to the console server and connect the port 1 to its serial port and start the stub by 'gdbstart -s 38400 -t /dev/ttyS0', and go the development box to start the gdb and try to access the target box by 'target remote server-ipaddr:2001'. But it fails...... I don't know what's wrong. Thanks GF