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: Return value of program being debugged


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


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