Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: PATCH: really close the extended-remote target if we lose the connection
Date: Tue, 14 Oct 2008 22:08:00 -0000	[thread overview]
Message-ID: <200810142307.48530.pedro@codesourcery.com> (raw)
In-Reply-To: <200810142303.28790.pedro@codesourcery.com>

Sorry, I forgot an important detail in the explanations below.  Hope the
below makes it clearer.

On Tuesday 14 October 2008 23:03:28, Pedro Alves wrote:
> Check out this difference between target remote, and target extended-remote:
> 
> target remote:
> 
>  >./gdb /home/pedro/gdb/tests/threads32
>  GNU gdb (GDB) 6.8.50.20081014-cvs
>  [...]
>  (gdb) tar remote :9999
>  Remote debugging using :9999
>  0xf7fbb810 in ?? () from /lib/ld-linux.so.2

      <insert "killall gdbserver" here>

>  (gdb) info threads
>  Remote connection closed
>  (gdb) maint print target-stack
>  The current target stack is:
>    - exec (Local exec file)
>    - None (None)
>  (gdb) q
>  [nothing]
> 
> target extended-remote:
> 
>  >./gdb /home/pedro/gdb/tests/threads32
>  GNU gdb (GDB) 6.8.50.20081014-cvs
>  [...]
>  (gdb) tar extended-remote :9999
>  Remote debugging using :9999
>  0xf7f70810 in ?? () from /lib/ld-linux.so.2
>  (gdb) c
>  Continuing.
>  [Switching to Thread 22227]

      <insert "killall gdbserver" here>

>  Remote connection closed
>  (gdb) info threads
>  putpkt: write failed: Broken pipe.
>  (gdb)  
>  
>  (gdb) maint print target-stack
>  The current target stack is:
>    - extended-remote (Extended remote serial target in gdb-specific protocol)
>    - exec (Local exec file)
>    - None (None)
>  (gdb)
>  
>  (gdb) q
>  The program is running.  Quit anyway (and kill it)? (y or n) y
>  Quitting: putpkt: write failed: Broken pipe.
> 
> The issue is again the mixup of "target" as in
> 'interface'/'debug api'/'connection to system', vs "target" as in "inferior".
> 
> In the remote target, a target_mourn_inferior unpushes the target_ops,
> while in the extended-remote target, it doesn't, leaving the user with
> a useless broken connection.
> 
> The attached patch makes the extended-remote behave the same as the
> remote target.  Considering an extended-remote connection debugging
> multi-processes seems to make it clearer that target_mourn_inferior
> isn't the right call here, me thinks.
> 
> There are cases in async mode that when the connection was broken,
> we'd leave the SIGINT signal handler set to handle_remote_sigint or
> handle_remote_sigint_twice, although we had already poped the target,
> which would result in later crashes.  I'm also making sure in remote_close
> that that doesn't happen.
> 
> Any objections to this?
> 
> No regressions on x86_64-unknown-linux-gnu (sync/async).
> 



-- 
Pedro Alves


  reply	other threads:[~2008-10-14 22:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-14 22:03 Pedro Alves
2008-10-14 22:08 ` Pedro Alves [this message]
2008-10-15 13:14 ` Daniel Jacobowitz
2008-10-15 21:41   ` 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=200810142307.48530.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@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