Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Atul Talesara" <atul.talesara@nevisnetworks.com>
To: <gdb@sources.redhat.com>
Subject: RE: Problems: Remote debugging over UDP.
Date: Tue, 24 Feb 2004 13:01:00 -0000	[thread overview]
Message-ID: <36993D449C7FA647BF43568E0793AB3E4C8611@nevis_pune_xchg.pune.nevisnetworks.com> (raw)

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) = 3
               ^^^^^^^^^^^^^^
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sin_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}}, 16) = 0
listen(3, 1)                            = 0
accept(3,  <unfinished ...>
            ^^^^^^^^^^^^^^^  <-- 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.
> 
> 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.
> 
> On Target I do the following:
> ------------------------------
> gdbserver udp:localhost:9090 ./hello
>           ^^^
> 
> I get the following output:
> Process ./hello created; pid=2135
> 
> 
> On Host I do:
> --------------
> gdb ./hello
> 
> gdb> target remote udp:localhost:9090
>                    ^^^
> 
> and get the following o/p:
> Remote debugging using udp:localhost:9090
> Couldn't establish connection to remote target
> putpkt: write failed: connection refused.
> 
> 
> 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?
> 
> 
> 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
> ------------------------------------------------------------------


             reply	other threads:[~2004-02-24 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-24 13:01 Atul Talesara [this message]
2004-02-24 14:33 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2004-02-24 14:55 Arun Vishwanathan
2004-02-24 16:51 ` Daniel Jacobowitz
2004-02-23 13:10 Atul Talesara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36993D449C7FA647BF43568E0793AB3E4C8611@nevis_pune_xchg.pune.nevisnetworks.com \
    --to=atul.talesara@nevisnetworks.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox