From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15459 invoked by alias); 21 Jul 2009 18:07:12 -0000 Received: (qmail 15447 invoked by uid 22791); 21 Jul 2009 18:07:11 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jul 2009 18:07:05 +0000 Received: from zps37.corp.google.com (zps37.corp.google.com [172.25.146.37]) by smtp-out.google.com with ESMTP id n6LI747R007332 for ; Tue, 21 Jul 2009 11:07:04 -0700 Received: from localhost (ppluzhnikov.mtv.corp.google.com [172.18.118.92]) by zps37.corp.google.com with ESMTP id n6LI713m007801; Tue, 21 Jul 2009 11:07:01 -0700 Received: by localhost (Postfix, from userid 74925) id 03C3F76BC0; Tue, 21 Jul 2009 11:07:00 -0700 (PDT) To: gdb-patches@sourceware.org Cc: ppluzhnikov@google.com Subject: [patch] Emit failed assertion when 'set confirm off' is in effect. Message-Id: <20090721180701.03C3F76BC0@localhost> Date: Tue, 21 Jul 2009 18:09:00 -0000 From: ppluzhnikov@google.com (Paul Pluzhnikov) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00517.txt.bz2 Greetings, I run GDB with 'set confirm off' in ~/.gdbinit. Unfortunately, with this setting GDB *silently* aborts on internal error, and I have to run GDB under itself to find out what happened. Attached patch changes this so that internal_error reason is printed even with 'set confirm off'. Thanks, -- Paul Pluzhnikov 2009-07-21 Paul Pluzhnikov * util.c (internal_vproblem): Always print failure message. Index: utils.c =================================================================== RCS file: /cvs/src/src/gdb/utils.c,v retrieving revision 1.214 diff -u -p -u -r1.214 utils.c --- utils.c 21 Jul 2009 03:31:18 -0000 1.214 +++ utils.c 21 Jul 2009 17:58:43 -0000 @@ -933,7 +933,15 @@ further debugging may prove unreliable." /* Default (yes/batch case) is to quit GDB. When in batch mode this lessens the likelihood of GDB going into an infinite loop. */ - quit_p = query (_("%s\nQuit this debugging session? "), reason); + if (caution == 0) + { + /* Emit the message and quit. */ + fputs_unfiltered (reason, gdb_stderr); + fputs_unfiltered ("\n", gdb_stderr); + quit_p = 1; + } + else + quit_p = query (_("%s\nQuit this debugging session? "), reason); } else if (problem->should_quit == internal_problem_yes) quit_p = 1;