This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Return value of program being debugged
- From: Daniel Jacobowitz <drow at false dot org>
- To: Grzegorz Cieslewski <cieslewski at hcs dot ufl dot edu>
- Cc: gdb at sourceware dot org
- Date: Sat, 15 Dec 2007 10:07:22 -0500
- Subject: Re: Return value of program being debugged
- References: <7aa837f80712150633t11dbfc41wb865f5797cc1d897@mail.gmail.com>
On Sat, Dec 15, 2007 at 09:33:02AM -0500, Grzegorz Cieslewski wrote:
> (gdb) r
> Starting program: /tmp/test
>
> Program exited with code 0377.
> (gdb) q
>
> Could someone tell me how is "-1" mapped to "0377"?
(gdb) p/x 0377
$1 = 0xff
Take a look at the manual page for waitpid, and the definitions of the
various waitstatus macros, to see how Unix systems represent exit
codes.
--
Daniel Jacobowitz
CodeSourcery