This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: RFC: GDB as a loader 2/3: return child result
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 03 Nov 2005 11:55:32 +0000
- Subject: Re: RFC: GDB as a loader 2/3: return child result
- References: <4354DC55.4090706@st.com> <436205A6.9010403@st.com> <u8xwder3a.fsf@gnu.org> <43622E2A.9050600@st.com> <u1x25efvg.fsf@gnu.org>
Eli Zaretskii wrote:
Ok. How about the attached?
The new text is fine, thanks.
+@value{GDBN} exits abnormally. E.g. due to an incorrect argument or an
"E.g." should be followed by a comma.
Patch with commas attached.
Am I ok to submit the code and docs patches now?
Thanks
Andrew
2005-10-03 Andrew Stubbs <andrew.stubbs@st.com>
* gdb.texinfo (Choosing modes): Add --return-child-result.
Index: src/gdb/doc/gdb.texinfo
===================================================================
--- src.orig/gdb/doc/gdb.texinfo 2005-10-31 12:18:35.000000000 +0000
+++ src/gdb/doc/gdb.texinfo 2005-10-31 13:04:56.000000000 +0000
@@ -1007,6 +1007,27 @@ messages, for example.
Note that targets that give their output via @value{GDBN}, as opposed to
writing directly to @code{stdout}, will also be made silent.
+@item -return-child-result
+@cindex @code{--return-child-result}
+The return code from @value{GDBN} will be the return code from the child
+process (the process being debugged), with the following exceptions:
+
+@itemize @bullet
+@item
+@value{GDBN} exits abnormally. E.g., due to an incorrect argument or an
+internal error. In this case the exit code is the same as it would have been
+without @samp{-return-child-result}.
+@item
+The user quits with an explicit value. E.g., @samp{quit 1}.
+@item
+The child process never runs, or is not allowed to terminate, in which case
+the exit code will be -1.
+@end itemize
+
+This option is useful in conjunction with @samp{-batch} or @samp{-batch-silent},
+when @value{GDBN} is being used as a remote program loader or simulator
+interface.
+
@item -nowindows
@itemx -nw
@cindex @code{--nowindows}