From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24431 invoked by alias); 24 Feb 2004 13:01:45 -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 24412 invoked from network); 24 Feb 2004 13:01:43 -0000 Received: from unknown (HELO mail.pune.nevisnetworks.com) (203.124.166.179) by sources.redhat.com with SMTP; 24 Feb 2004 13:01:43 -0000 Received: from nevis_pune_xchg.pune.nevisnetworks.com (nevis_pune_xchg.pune.nevisnetworks.com [192.168.2.7]) by mail.pune.nevisnetworks.com (8.12.5/8.12.5) with ESMTP id i1OD639G027259 for ; Tue, 24 Feb 2004 18:36:04 +0530 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Problems: Remote debugging over UDP. Date: Tue, 24 Feb 2004 13:01:00 -0000 Message-ID: <36993D449C7FA647BF43568E0793AB3E4C8611@nevis_pune_xchg.pune.nevisnetworks.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Atul Talesara" To: X-SW-Source: 2004-02/txt/msg00337.txt.bz2 Is it that "gdbserver" doesn't talk over UDP??? Because when I do the following: gdbserver udp:my_system:9000 test_program I don't see the port "9000" (with netstat -elp)to be occupied by any of the processes! Whereas I can see the port used when I do the same over TCP. Also, "strace" revealed that gdbserver NEVER opens a SOCK_DGRAM (UDP) socket!!! Here are the last few lines that actually opens the socket: ------------------------------------------------------- . . . socket(PF_INET, SOCK_STREAM, IPPROTO_IP) =3D 3 ^^^^^^^^^^^^^^ setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) =3D 0 bind(3, {sin_family=3DAF_INET, sin_port=3Dhtons(0), sin_addr=3Dinet_addr("0.0.0.0")}}, 16) =3D 0 listen(3, 1) =3D 0 accept(3, ^^^^^^^^^^^^^^^ <-- I kill strace here ------------------------------------------------------- At this point when I again do netstat, I see gdbserver running on some ephemeral TCP port and not UDP port 9000 :-( since port '0' is passed to "bind()" call. This is the GDB that I'm using and gdbserver coupled with it. ------------------------------------------------------- bash-2.05b$ ~/local/bin/gdb -v GNU gdb 20040223 Copyright 2004 Free Software Foundation, Inc. ------------------------------------------------------- Thanks in advance. Atul P Talesara ------------------------------------------------------------------ When "Winning" and "Losing" don't have any meaning, that is when the real game happens, play happens. Otherwise it is war. War has a significance for Winning or Losing. -Sri Sri ------------------------------------------------------------------ > -----Original Message----- > From: gdb-owner@sources.redhat.com [mailto:gdb-owner@sources.redhat.com] > On Behalf Of Atul Talesara > Sent: Monday, February 23, 2004 6:41 PM > To: gdb@sources.redhat.com > Subject: Problems: Remote debugging over UDP. >=20 > Hello Everybody, > I have had problems while attempting remote debugging over UDP. > For ease, I used same system as target and host. Also, I'm > logged in as "root" on both the consoles. >=20 > On Target I do the following: > ------------------------------ > gdbserver udp:localhost:9090 ./hello > ^^^ >=20 > I get the following output: > Process ./hello created; pid=3D2135 >=20 >=20 > On Host I do: > -------------- > gdb ./hello >=20 > gdb> target remote udp:localhost:9090 > ^^^ >=20 > and get the following o/p: > Remote debugging using udp:localhost:9090 > Couldn't establish connection to remote target > putpkt: write failed: connection refused. >=20 >=20 > When I omit the "UDP" part, i.e. use TCP, everything > works smoothly w same steps! Am I missing something important > here because of which GDB over UDP is not working? Can anyone > pl provide some inputs? >=20 >=20 > Thanks and Regards, > Atul P Talesara > ------------------------------------------------------------------ > When "Winning" and "Losing" don't have any meaning, that is when > the real game happens, play happens. Otherwise it is war. > War has a significance for Winning or Losing. > -Sri Sri > ------------------------------------------------------------------