From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14304 invoked by alias); 7 Nov 2005 12:20:51 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 14283 invoked by uid 22791); 7 Nov 2005 12:20:43 -0000 Received: from lon-del-03.spheriq.net (HELO lon-del-03.spheriq.net) (195.46.50.99) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 07 Nov 2005 12:20:43 +0000 Received: from lon-out-03.spheriq.net ([195.46.50.131]) by lon-del-03.spheriq.net with ESMTP id jA7CKeDq023467 for ; Mon, 7 Nov 2005 12:20:40 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-03.spheriq.net with ESMTP id jA7CKd7Q015466 for ; Mon, 7 Nov 2005 12:20:39 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-02.spheriq.net with ESMTP id jA7CKaqg003132 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 7 Nov 2005 12:20:38 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3E26CDA78; Mon, 7 Nov 2005 12:19:41 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id D562147276; Mon, 7 Nov 2005 12:22:35 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 58A0975995; Mon, 7 Nov 2005 12:22:35 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CF7834732D; Mon, 7 Nov 2005 12:22:34 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CGG00016 (AUTH "andrew stubbs"); Mon, 7 Nov 2005 12:19:38 GMT Message-ID: <436F45D7.6010306@st.com> Date: Mon, 07 Nov 2005 12:20:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: RFC: GDB as a loader 2/3: return child result References: <4354DC55.4090706@st.com> <20051105024606.GA20989@nevyn.them.org> In-Reply-To: <20051105024606.GA20989@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------080600010700060406040705" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 X-SW-Source: 2005-11/txt/msg00143.txt.bz2 This is a multi-part message in MIME format. --------------080600010700060406040705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 422 Daniel Jacobowitz wrote: > Sorry, I never got around to looking at the code portion of this. > Would you mind making one cleanup for me? > > It doesn't really matter which header the externs go in. But they have > to go in a header, visible at both the point of definition and the > point of use. No externs in C files. top.h or main.h should be fine. Ok. How about the attached modification? Thanks Andrew Stubbs --------------080600010700060406040705 Content-Type: text/plain; name="move-externs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="move-externs.patch" Content-length: 2314 2005-11-07 Andrew Stubbs * main.h (return_child_result, return_child_result_value): Declare. * infrun.h: Include main.h. (print_stop_reason): Remove declaration of return_child_result_value. * top.c; Include main.h. (quit_force): Remove declarations of return_child_result_value and return_child_result. Index: src/gdb/infrun.c =================================================================== --- src.orig/gdb/infrun.c 2005-11-04 11:42:07.000000000 +0000 +++ src/gdb/infrun.c 2005-11-07 12:00:36.000000000 +0000 @@ -46,6 +46,7 @@ #include "observer.h" #include "language.h" #include "solib.h" +#include "main.h" #include "gdb_assert.h" #include "mi/mi-common.h" @@ -2931,11 +2932,8 @@ print_stop_reason (enum inferior_stop_re async_reason_lookup (EXEC_ASYNC_EXITED_NORMALLY)); ui_out_text (uiout, "\nProgram exited normally.\n"); } - { - /* Support the --return-child-result option. */ - extern int return_child_result_value; - return_child_result_value = stop_info; - } + /* Support the --return-child-result option. */ + return_child_result_value = stop_info; break; case SIGNAL_RECEIVED: /* Signal received. The signal table tells us to print about Index: src/gdb/main.h =================================================================== --- src.orig/gdb/main.h 2003-02-13 18:07:24.000000000 +0000 +++ src/gdb/main.h 2005-11-07 11:59:07.000000000 +0000 @@ -32,4 +32,8 @@ struct captured_main_args extern int gdb_main (struct captured_main_args *); +/* From main.c. */ +extern int return_child_result; +extern int return_child_result_value; + #endif Index: src/gdb/top.c =================================================================== --- src.orig/gdb/top.c 2005-11-07 11:50:21.000000000 +0000 +++ src/gdb/top.c 2005-11-07 11:56:17.000000000 +0000 @@ -46,6 +46,7 @@ #include "serial.h" #include "doublest.h" #include "gdb_assert.h" +#include "main.h" /* readline include files */ #include "readline/readline.h" @@ -1177,7 +1178,6 @@ quit_force (char *args, int from_tty) { int exit_code = 0; struct qt_args qt; - extern int return_child_result, return_child_result_value; /* An optional expression may be used to cause gdb to terminate with the value of that expression. */ --------------080600010700060406040705--