Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [patch/rfc] internal-error quit by default ..
Date: Sun, 13 Jan 2002 12:54:00 -0000	[thread overview]
Message-ID: <3C41F3E7.3060308@cygnus.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Hello,

This patch follows up a proposed change from long ago.  Update things so 
that when in batch mode (i.e. no tty) an internal-error will:

	quit
	dump core

this adjusts things accordingly.  For the user, the resultant behavour is:

(gdb) maint internal-error
gdb/maint.c:119: gdb-internal-error: internal maintenance
An internal GDB error was detected.  This may make further
debugging unreliable.  Quit this debugging session? (y or n) y

Create a core file containing the current state of GDB? (y or n) y
Abort trap (core dumped)
ac131313@nettle$

Unless someone raises a problem.  I'll commit it in a few days.

enjoy,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3786 bytes --]

2002-01-13  Andrew Cagney  <ac131313@redhat.com>

	* utils.c (internal_verror): Fix comments, default is yes not no.
	Update queries to match.  Default to quit and dump core.

Index: testsuite/ChangeLog
2002-01-13  Andrew Cagney  <ac131313@redhat.com>

	* gdb.base/maint.exp: Update ``maint internal-error'' to match
	continue/quit query.

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.54
diff -p -r1.54 utils.c
*** utils.c	2002/01/05 05:54:30	1.54
--- utils.c	2002/01/13 20:42:06
*************** internal_verror (const char *file, int l
*** 694,700 ****
  {
    static char msg[] = "Internal GDB error: recursive internal error.\n";
    static int dejavu = 0;
!   int continue_p;
    int dump_core_p;
  
    /* don't allow infinite error recursion. */
--- 694,700 ----
  {
    static char msg[] = "Internal GDB error: recursive internal error.\n";
    static int dejavu = 0;
!   int quit_p;
    int dump_core_p;
  
    /* don't allow infinite error recursion. */
*************** internal_verror (const char *file, int l
*** 719,749 ****
    vfprintf_unfiltered (gdb_stderr, fmt, ap);
    fputs_unfiltered ("\n", gdb_stderr);
  
!   /* Default (no case) is to quit GDB.  When in batch mode this
       lessens the likelhood of GDB going into an infinate loop. */
!   continue_p = query ("\
  An internal GDB error was detected.  This may make further\n\
! debugging unreliable.  Continue this debugging session? ");
  
!   /* Default (no case) is to not dump core.  Lessen the chance of GDB
!      leaving random core files around. */
    dump_core_p = query ("\
  Create a core file containing the current state of GDB? ");
  
!   if (continue_p)
      {
        if (dump_core_p)
! 	{
! 	  if (fork () == 0)
! 	    abort (); /* NOTE: GDB has only three calls to abort().  */
! 	}
      }
    else
      {
        if (dump_core_p)
! 	abort (); /* NOTE: GDB has only three calls to abort().  */
!       else
! 	exit (1);
      }
  
    dejavu = 0;
--- 719,750 ----
    vfprintf_unfiltered (gdb_stderr, fmt, ap);
    fputs_unfiltered ("\n", gdb_stderr);
  
!   /* Default (yes/batch case) is to quit GDB.  When in batch mode this
       lessens the likelhood of GDB going into an infinate loop. */
!   quit_p = query ("\
  An internal GDB error was detected.  This may make further\n\
! debugging unreliable.  Quit this debugging session? ");
  
!   /* Default (yes/batch case) is to dump core.  This leaves a GDB
!      dropping so that it is easier to see that something went wrong to
!      GDB. */
    dump_core_p = query ("\
  Create a core file containing the current state of GDB? ");
  
!   if (quit_p)
      {
        if (dump_core_p)
! 	abort (); /* NOTE: GDB has only three calls to abort().  */
!       else
! 	exit (1);
      }
    else
      {
        if (dump_core_p)
! 	{
! 	  if (fork () == 0)
! 	    abort (); /* NOTE: GDB has only three calls to abort().  */
! 	}
      }
  
    dejavu = 0;
Index: testsuite/gdb.base/maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.9
diff -p -r1.9 maint.exp
*** maint.exp	2002/01/05 02:40:47	1.9
--- maint.exp	2002/01/13 20:44:01
*************** gdb_expect  {
*** 660,667 ****
  
  send_gdb "maint internal-error\n"
  gdb_expect  {
!     -re "Continue this debugging session.*\\(y or n\\) $" {
! 	send_gdb "y\n"
  	gdb_expect {
  	    -re "Create a core file.*\\(y or n\\) $" {
  		send_gdb "n\n"
--- 660,667 ----
  
  send_gdb "maint internal-error\n"
  gdb_expect  {
!     -re "Quit this debugging session.*\\(y or n\\) $" {
! 	send_gdb "n\n"
  	gdb_expect {
  	    -re "Create a core file.*\\(y or n\\) $" {
  		send_gdb "n\n"

             reply	other threads:[~2002-01-13 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-13 12:54 Andrew Cagney [this message]
2002-01-14  0:11 ` Eli Zaretskii
2002-01-17 14:35   ` Andrew Cagney
2002-01-18  0:29     ` Eli Zaretskii
2002-01-17 15:31 ` Andrew Cagney

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=3C41F3E7.3060308@cygnus.com \
    --to=ac131313@cygnus.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