* [patch/rfc] internal-error quit by default ..
@ 2002-01-13 12:54 Andrew Cagney
2002-01-14 0:11 ` Eli Zaretskii
2002-01-17 15:31 ` Andrew Cagney
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-01-13 12:54 UTC (permalink / raw)
To: gdb-patches
[-- 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"
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch/rfc] internal-error quit by default ..
2002-01-13 12:54 [patch/rfc] internal-error quit by default Andrew Cagney
@ 2002-01-14 0:11 ` Eli Zaretskii
2002-01-17 14:35 ` Andrew Cagney
2002-01-17 15:31 ` Andrew Cagney
1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2002-01-14 0:11 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Sun, 13 Jan 2002, Andrew Cagney wrote:
> 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.
We need to document this in gdb.texinfo.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] internal-error quit by default ..
2002-01-14 0:11 ` Eli Zaretskii
@ 2002-01-17 14:35 ` Andrew Cagney
2002-01-18 0:29 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2002-01-17 14:35 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> On Sun, 13 Jan 2002, Andrew Cagney wrote:
>
>
>> 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.
>
>
> We need to document this in gdb.texinfo.
You mean GDB's behavour when in batch mode or no TTY? Yes. I'll do a
bug report for this one before I forget it.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] internal-error quit by default ..
2002-01-17 14:35 ` Andrew Cagney
@ 2002-01-18 0:29 ` Eli Zaretskii
0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2002-01-18 0:29 UTC (permalink / raw)
To: ac131313; +Cc: gdb-patches
> Date: Thu, 17 Jan 2002 17:35:56 -0500
> From: Andrew Cagney <ac131313@cygnus.com>
>
> >> quit
> >> dump core
> >>
> >> this adjusts things accordingly.
> >
> > We need to document this in gdb.texinfo.
>
> You mean GDB's behavour when in batch mode or no TTY?
Yes, that's what I meant. Sorry for being unclear.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] internal-error quit by default ..
2002-01-13 12:54 [patch/rfc] internal-error quit by default Andrew Cagney
2002-01-14 0:11 ` Eli Zaretskii
@ 2002-01-17 15:31 ` Andrew Cagney
1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-01-17 15:31 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
> 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.
>
>
I've checked this part in. Eli, I've also got to doco this command.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-01-18 8:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-13 12:54 [patch/rfc] internal-error quit by default Andrew Cagney
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox