Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>, "J. Johnston" <jjohnstn@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFC: fix problems with errors during quitting (killed.exp)
Date: Wed, 10 Sep 2003 18:36:00 -0000	[thread overview]
Message-ID: <3F5F6F2C.2030403@redhat.com> (raw)
In-Reply-To: <20030905155833.GA27258@nevyn.them.org>

>> 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.
> 
> 
> My immediate concern is, does killed.exp leave a stopped binary around?
> 
> Other than that I like it.

I feel ill.

The first bug is in quit_force, so modifying throw_exeption to work 
around it is a hack.  quit_force needs to catch any errors thrown by the 
target vector.

Looking at the function's body.  I think the first part:

>   /* An optional expression may be used to cause gdb to terminate with the 
>      value of that expression. */
>   if (args)
>     {
>       struct value *val = parse_and_eval (args);
> 
>       exit_code = (int) value_as_long (val);
>     }

should still be allowed to error out.  Otherwize something like:

	(gdb) exit bogus operand

will quit gdb denying the user of an oportunity to enter the correct 
command.  The target calls and (I guess) the write_history should be 
captured:

>   if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
>     {
>       if (attach_flag)
>         target_detach (args, from_tty);
>       else
>         target_kill ();
>     }
> 
>   /* UDI wants this, to kill the TIP.  */
>   target_close (1);
> 
>   /* Save the history information if it is appropriate to do so.  */
>   if (write_history_p && history_filename)
>     write_history (history_filename);

Also putting the do_final_cleanups inside the safety net would also 
probably be for the best.

>   do_final_cleanups (ALL_CLEANUPS);     /* Do any final cleanups before exiting 




The second less urgent bug is in the target code.  The target code 
should catch the error and then force itself to be popped (then 
rethrowing the error I guess).  That would have ensured that forward 
progress was made and that second quit attemt worked.

Andrew


  parent reply	other threads:[~2003-09-10 18:36 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
2003-09-05 18:01   ` J. Johnston
2003-09-10 18:36   ` Andrew Cagney [this message]
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=3F5F6F2C.2030403@redhat.com \
    --to=ac131313@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@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