From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: RFC: fix problems with errors during quitting (killed.exp)
Date: Fri, 05 Sep 2003 15:58:00 -0000 [thread overview]
Message-ID: <20030905155833.GA27258@nevyn.them.org> (raw)
In-Reply-To: <3F58B193.5090400@redhat.com>
On Fri, Sep 05, 2003 at 11:53:55AM -0400, J. Johnston wrote:
> The following patch fixes the problem that occurs when an error happens
> while
> quitting. Often an error() call gets triggered and the poor user is thrown
> back to the gdb command line where they try to quit again. I made an
> attempt
> to fix a similar problem by handling ptrace errors in quitting, however,
> thread-db.c gets
> into multiple precarious situations because it has to rely on libthread_db
> for information. When the thread has been killed/maimed, it gets errors
> when
> they are not expected and quitting becomes impossible.
>
> My new strategy is to intercept error() calls during quitting. Basically,
> a simple get/set function is set up to denote when we the user has confirmed
> a quit. If we get into top.c:throw_exception() and quit has been
> confirmed, it
> exits the program. This handles any number of messy kill scenarios and
> causes
> no regressions in the current testsuite. It fixes gdb.threads/killed.exp.
> I made the
> functions external so other parts of gdb can register a confirmed quit if
> necessary. I could
> make these routines static if this feature is not needed. I chose to exit
> with the
> code being passed on the jump. There may be a better constant choice.
>
> If anyone can think of scenario that this code is not going to handle
> correctly that might
> not be exercised by the testsuite, please let me know.
>
> Tested on x86 and ia64.
>
> Comments?
My immediate concern is, does killed.exp leave a stopped binary around?
Other than that I like it.
> 2003-09-04 Jeff Johnston <jjohnstn@redhat.com>
>
> * top.h (get_quit_confirmed, set_quit_confirmed): New prototypes.
> * top.c (get_quit_confirmed, set_quit_confirmed): New functions.
> (throw_exception): If quit confirmed, exit instead of jumping.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-09-05 15:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-05 15:54 J. Johnston
2003-09-05 15:58 ` Daniel Jacobowitz [this message]
2003-09-05 18:01 ` J. Johnston
2003-09-10 18:36 ` Andrew Cagney
2003-09-11 20:11 ` J. Johnston
2003-09-11 22:38 ` Andrew Cagney
2003-09-12 15:38 ` J. Johnston
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=20030905155833.GA27258@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@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