* Return value of program being debugged
@ 2007-12-15 14:33 Grzegorz Cieslewski
2007-12-15 15:07 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Grzegorz Cieslewski @ 2007-12-15 14:33 UTC (permalink / raw)
To: gdb
Hi,
I have encountered an interesting problem.
Upon executing the program:
int main()
{
return(-1);
}
in gdb I get the following output
(gdb) r
Starting program: /tmp/test
Program exited with code 0377.
(gdb) q
Could someone tell me how is "-1" mapped to "0377"?
Greg
--
=====================================================
Grzegorz Cieslewski
Research Assistant
High-performance Computing & Simulation (HCS) Research Laboratory
University of Florida, Dept. of Electrical and Computer Engineering
330 Benton Hall, Gainesville, FL, 32611-6200
Phone: (352) 392-9041
Email: cieslewski@hcs.ufl.edu
Web: www.hcs.ufl.edu
=====================================================
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Return value of program being debugged
2007-12-15 14:33 Return value of program being debugged Grzegorz Cieslewski
@ 2007-12-15 15:07 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-12-15 15:07 UTC (permalink / raw)
To: Grzegorz Cieslewski; +Cc: gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-15 15:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-15 14:33 Return value of program being debugged Grzegorz Cieslewski
2007-12-15 15:07 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox