public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com
Subject: Re: RFC: GDB as a loader 2/3: return child result
Date: Mon, 07 Nov 2005 12:20:00 -0000	[thread overview]
Message-ID: <436F45D7.6010306@st.com> (raw)
In-Reply-To: <20051105024606.GA20989@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

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

[-- Attachment #2: move-externs.patch --]
[-- Type: text/plain, Size: 2314 bytes --]

2005-11-07  Andrew Stubbs  <andrew.stubbs@st.com>

	* 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. */

  reply	other threads:[~2005-11-07 12:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-18 11:30 Andrew STUBBS
2005-10-28 11:06 ` Andrew STUBBS
2005-10-28 12:58   ` Eli Zaretskii
2005-10-28 14:01     ` Andrew STUBBS
2005-10-28 17:00       ` Eli Zaretskii
2005-11-03 11:57         ` Andrew STUBBS
2005-11-04 10:46           ` Eli Zaretskii
2005-11-04 11:52             ` Andrew STUBBS
2005-11-05  2:46 ` Daniel Jacobowitz
2005-11-07 12:20   ` Andrew STUBBS [this message]
2005-11-07 14:02     ` Daniel Jacobowitz
2005-11-07 14:40       ` Andrew STUBBS
2005-11-07 14:42         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=436F45D7.6010306@st.com \
    --to=andrew.stubbs@st.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).