From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13777 invoked by alias); 7 Nov 2005 14:40:07 -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 13624 invoked by uid 22791); 7 Nov 2005 14:40:01 -0000 Received: from fra-del-02.spheriq.net (HELO fra-del-02.spheriq.net) (195.46.51.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 07 Nov 2005 14:40:01 +0000 Received: from fra-out-03.spheriq.net (fra-out-03.spheriq.net [195.46.51.131]) by fra-del-02.spheriq.net with ESMTP id jA7Edwjq029047 for ; Mon, 7 Nov 2005 14:39:58 GMT Received: from fra-cus-01.spheriq.net (fra-cus-01.spheriq.net [195.46.51.37]) by fra-out-03.spheriq.net with ESMTP id jA7EdvH6011957 for ; Mon, 7 Nov 2005 14:39:57 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-01.spheriq.net with ESMTP id jA7EdtbC003170 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 7 Nov 2005 14:39:56 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 B43EADA46; Mon, 7 Nov 2005 14:39:54 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 51364473DA; Mon, 7 Nov 2005 14:42:49 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 96754759B2; Mon, 7 Nov 2005 14:42:48 +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 5B5A0473E7; Mon, 7 Nov 2005 14:42:47 +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 CGG01200 (AUTH "andrew stubbs"); Mon, 7 Nov 2005 14:39:51 GMT Message-ID: <436F66B3.9090607@st.com> Date: Mon, 07 Nov 2005 14:40: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> <436F45D7.6010306@st.com> <20051107140213.GA3114@nevyn.them.org> In-Reply-To: <20051107140213.GA3114@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------090000040107060808010008" 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/msg00152.txt.bz2 This is a multi-part message in MIME format. --------------090000040107060808010008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 350 Daniel Jacobowitz wrote: > Perfect with one addition: > > >> * infrun.h: Include main.h. >> * top.c; Include main.h. > > > These mean you need to update Makefile.in, too. We use mostly manually > computed dependencies. Ok, I didn't know that (but should've guessed). Updated patch attached. I've also fixed the typos in the changelog. Andrew --------------090000040107060808010008 Content-Type: text/plain; name="move-externs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="move-externs.patch" Content-length: 3579 2005-11-07 Andrew Stubbs * main.h (return_child_result, return_child_result_value): Declare. * infrun.c: 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. * Makefile.in (top.o, infrun.o): Add main.h to dependencies. Index: src/gdb/infrun.c =================================================================== --- src.orig/gdb/infrun.c 2005-11-07 12:23:30.000000000 +0000 +++ src/gdb/infrun.c 2005-11-07 14:18:29.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 2005-11-07 12:23:30.000000000 +0000 +++ src/gdb/main.h 2005-11-07 14:18:29.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 12:23:30.000000000 +0000 +++ src/gdb/top.c 2005-11-07 14:18:29.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. */ Index: src/gdb/Makefile.in =================================================================== --- src.orig/gdb/Makefile.in 2005-11-01 10:32:11.000000000 +0000 +++ src/gdb/Makefile.in 2005-11-07 14:26:39.000000000 +0000 @@ -2133,7 +2133,7 @@ infrun.o: infrun.c $(defs_h) $(gdb_strin $(gdbcore_h) $(gdbcmd_h) $(cli_script_h) $(target_h) $(gdbthread_h) \ $(annotate_h) $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) \ $(value_h) $(observer_h) $(language_h) $(solib_h) $(gdb_assert_h) \ - $(mi_common_h) + $(mi_common_h) $(main_h) inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(command_h) $(gdb_stat_h) $(observer_h) $(gdb_wait_h) \ $(inflow_h) @@ -2689,7 +2689,7 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(cal $(annotate_h) $(completer_h) $(top_h) $(version_h) $(serial_h) \ $(doublest_h) $(gdb_assert_h) $(readline_h) $(readline_history_h) \ $(event_top_h) $(gdb_string_h) $(gdb_stat_h) $(ui_out_h) \ - $(cli_out_h) + $(cli_out_h) $(main_h) tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ --------------090000040107060808010008--