From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17959 invoked by alias); 2 May 2008 11:35:48 -0000 Received: (qmail 17949 invoked by uid 22791); 2 May 2008 11:35:47 -0000 X-Spam-Check-By: sourceware.org Received: from s200aog13.obsmtp.com (HELO s200aog13.obsmtp.com) (207.126.144.127) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 May 2008 11:35:25 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob013.postini.com ([207.126.147.11]) with SMTP; Fri, 02 May 2008 11:35:22 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F2E8DDABC for ; Fri, 2 May 2008 11:35:09 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 64C6E4C0FC for ; Fri, 2 May 2008 11:35:09 +0000 (GMT) Received: from [164.129.12.194] (bri0669.bri.st.com [164.129.12.194]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CKD57718 (AUTH stubbsa); Fri, 2 May 2008 12:34:14 +0100 (BST) Message-ID: <481AFC65.3070706@st.com> Date: Fri, 02 May 2008 11:35:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: GDB Patches Subject: Re: [PATCH] Prevent source file errors in --batch-silent mode References: <480CD958.8010409@st.com> <20080501203347.GT22218@caradoc.them.org> In-Reply-To: <20080501203347.GT22218@caradoc.them.org> Content-Type: multipart/mixed; boundary="------------020202070807090904080301" 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: 2008-05/txt/msg00067.txt.bz2 This is a multi-part message in MIME format. --------------020202070807090904080301 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 196 Daniel Jacobowitz wrote: > This is OK, if you will move the extern to a header file. New version attached. There was prior art for this in event-top.c, so I've fixed that up also. OK? Andrew --------------020202070807090904080301 Content-Type: text/plain; name="batch-silent-interrupt.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="batch-silent-interrupt.patch" Content-length: 2139 2008-05-02 Andrew Stubbs * main.h (batch_silent): Declare. * event-top.c: Include main.h. (gdb_setup_readline): Remove extern batch_silent declaration. * infrun.c (normal_stop): Don't print source location when running in --batch-silent mode. Index: src2/gdb/infrun.c =================================================================== --- src2.orig/gdb/infrun.c 2008-05-02 10:34:13.000000000 +0100 +++ src2/gdb/infrun.c 2008-05-02 11:26:06.000000000 +0100 @@ -3171,7 +3171,10 @@ Further execution is probably impossible bpstat_print() contains the logic deciding in detail what to print, based on the event(s) that just occurred. */ - if (stop_print_frame) + /* If --batch-silent is enabled then there's no need to print the current + source location, and to try risks causing an error message about + missing source files. */ + if (stop_print_frame && !batch_silent) { int bpstat_ret; int source_flag; Index: src2/gdb/event-top.c =================================================================== --- src2.orig/gdb/event-top.c 2008-03-14 19:55:51.000000000 +0000 +++ src2/gdb/event-top.c 2008-05-02 11:24:30.000000000 +0100 @@ -31,6 +31,7 @@ #include #include "exceptions.h" #include "cli/cli-script.h" /* for reset_command_nest_depth */ +#include "main.h" /* For dont_repeat() */ #include "gdbcmd.h" @@ -1084,8 +1085,6 @@ gdb_setup_readline (void) that the sync setup is ALL done in gdb_init, and we would only mess it up here. The sync stuff should really go away over time. */ - extern int batch_silent; - if (!batch_silent) gdb_stdout = stdio_fileopen (stdout); gdb_stderr = stdio_fileopen (stderr); Index: src2/gdb/main.h =================================================================== --- src2.orig/gdb/main.h 2008-01-01 22:53:12.000000000 +0000 +++ src2/gdb/main.h 2008-05-02 11:24:05.000000000 +0100 @@ -33,5 +33,6 @@ extern int gdb_main (struct captured_mai /* From main.c. */ extern int return_child_result; extern int return_child_result_value; +extern int batch_silent; #endif --------------020202070807090904080301--