This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: GDB as a loader 2/3: return child result


On Tue, Oct 18, 2005 at 12:28:21PM +0100, Andrew STUBBS wrote:
> Hi all,
> 
> The attached patch implements a new option --return-child-result. This
> option causes GDB to return the return value of the last child
> (inferior) program to run. The patch assumes that the batch-silent patch
> has already been applied.
> 
> Note that 'quit <expr>' still works as expected. Also, any exit through
> a mechanism other than quit_force (i.e. errors) gives the same exit code
> as it did before. Batch mode has been adjusted to exit through
> quit_force in order to ensure it give the right result.
> 
> I am not sure that this has been implemented in the best way. The
> declaration of extern variables probably ought to be moved to a header
> file somewhere, but I'm not sure which is best. It has also been
> suggested that it ought to use the value stored in the existing
> $_exitcode convenience variable.

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.

Otherwise it looks great.  Thanks.


-- 
Daniel Jacobowitz
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]