From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23073 invoked by alias); 13 Jan 2002 20:54:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23034 invoked from network); 13 Jan 2002 20:53:59 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sources.redhat.com with SMTP; 13 Jan 2002 20:53:59 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 9DC173D1F for ; Sun, 13 Jan 2002 15:53:59 -0500 (EST) Message-ID: <3C41F3E7.3060308@cygnus.com> Date: Sun, 13 Jan 2002 12:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch/rfc] internal-error quit by default .. Content-Type: multipart/mixed; boundary="------------010001020704030205060100" X-SW-Source: 2002-01/txt/msg00359.txt.bz2 This is a multi-part message in MIME format. --------------010001020704030205060100 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 636 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 --------------010001020704030205060100 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 3786 2002-01-13 Andrew Cagney * 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 * 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" --------------010001020704030205060100--