Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: gdb@sourceware.org
Subject: Re: Multiple remote inferiors
Date: Fri, 08 Apr 2011 09:43:00 -0000	[thread overview]
Message-ID: <BANLkTinH3tUpZdGD2sGUa3h0mLuYTQk1BA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinjtiS6cp6WpS=8FULQJdxWuO7K8Q@mail.gmail.com>

Hi Pedro,

thanks for your answer, I gave it a try, but it seems to behave a bit strangely.

--> should it be possible to start _two different_ processes from a
single GDBServer ?

here is what I got (debugging functionPtr and stackoverflow):

> $ gdbserver :1234 functionPtr
> Process functionPtr created; pid = 10820
> Listening on port 1234
> Remote debugging from host 127.0.0.1
> Process functionPtr created; pid = 10825

> $ gdb functionPtr
> GNU gdb (GDB) Fedora (7.2-46.fc14)
> ...
> Reading symbols from /home/kevin/travail/arm/perso/root/sample/debug/functionPtr...done.
> (gdb) target extended-remote :1234
> Remote debugging using :1234
> ...
> (gdb) b main
> Breakpoint 1 at 0x400533: file ./functionPtr.c, line 8.
> (gdb) c
> Continuing.
> Breakpoint 1, main () at ./functionPtr.c:8
> 8 void (* my_say) (const char *) = NULL ;
>
> (gdb) add-inferior
> Added inferior 2
> (gdb) inferior 2
> [Switching to inferior 2 [Thread 0.0] (<noexec>)]
> (gdb) file stackoverflow
> Reading symbols from /home/kevin/travail/arm/perso/root/sample/debug/stackoverflow...done.
> (gdb) b main
> Breakpoint 2 at 0x400522: file stackoverflow.c, line 10.
> (gdb) r
> Starting program: /home/kevin/travail/arm/perso/root/sample/debug/stackoverflow
> Ignoring packet error, continuing...

GDBServer tries to start  functionPtr twice, as confirmed by the `pstree'

> $ pstree | grep functionPtr
>    .... bash---gdbserver---2*[functionPtr]

is it a bug or <del>a feature</del> a wrong usage of GDB ?


but ultimately, what I would like to do is connecting GDB to two
*different* gdbservers, ie maintain two TCP connections
simultaneously.


  parent reply	other threads:[~2011-04-08  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 15:02 Kevin Pouget
2011-04-06 17:44 ` Pedro Alves
2011-04-06 18:50   ` Kevin Pouget
2011-04-06 19:30     ` Pedro Alves
     [not found]       ` <BANLkTinjtiS6cp6WpS=8FULQJdxWuO7K8Q@mail.gmail.com>
2011-04-08  9:43         ` Kevin Pouget [this message]
2011-04-08 10:02           ` Jan Kratochvil
2011-04-08 10:00         ` Pedro Alves

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=BANLkTinH3tUpZdGD2sGUa3h0mLuYTQk1BA@mail.gmail.com \
    --to=kevin.pouget@gmail.com \
    --cc=gdb@sourceware.org \
    /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