aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorAndrew Stubbs <andrew.stubbs@st.com>2005-11-04 11:49:12 +0000
committerAndrew Stubbs <andrew.stubbs@st.com>2005-11-04 11:49:12 +0000
commit4b0ad76243714b959a63aa42649fa3cf6c886ef2 (patch)
tree510a04027769d4e032c7766378ed9475a363f296 /gdb/top.c
parentf6235d4cfac03962a505970ef92f231860c58517 (diff)
downloadfsf-binutils-gdb-4b0ad76243714b959a63aa42649fa3cf6c886ef2.zip
fsf-binutils-gdb-4b0ad76243714b959a63aa42649fa3cf6c886ef2.tar.gz
fsf-binutils-gdb-4b0ad76243714b959a63aa42649fa3cf6c886ef2.tar.bz2
2005-11-04 Andrew Stubbs <andrew.stubbs@st.com>
* infrun.c (print_stop_reason): Set return_child_result_value on exit. * main.c (return_child_result): New variable. (return_child_result_value): Likewise. (captured_main): Add option --return-child-result. Replace call to target_detach and exit (in batch mode) with quit_force. (print_gdb_help): Add option --return-child-result. * top.c (quit_force): Return child result if appropriate. docs/ * gdb.texinfo (Choosing modes): Add --return-child-result.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 98ad51b..a8bba83 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1177,6 +1177,7 @@ 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. */
@@ -1186,6 +1187,8 @@ quit_force (char *args, int from_tty)
exit_code = (int) value_as_long (val);
}
+ else if (return_child_result)
+ exit_code = return_child_result_value;
qt.args = args;
qt.from_tty = from_tty;