From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1499 invoked by alias); 15 Dec 2007 14:33:13 -0000 Received: (qmail 1490 invoked by uid 22791); 15 Dec 2007 14:33:13 -0000 X-Spam-Check-By: sourceware.org Received: from an-out-0708.google.com (HELO an-out-0708.google.com) (209.85.132.240) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 15 Dec 2007 14:33:04 +0000 Received: by an-out-0708.google.com with SMTP id c23so491336anc.42 for ; Sat, 15 Dec 2007 06:33:02 -0800 (PST) Received: by 10.100.253.12 with SMTP id a12mr9724347ani.66.1197729182155; Sat, 15 Dec 2007 06:33:02 -0800 (PST) Received: by 10.100.167.18 with HTTP; Sat, 15 Dec 2007 06:33:02 -0800 (PST) Message-ID: <7aa837f80712150633t11dbfc41wb865f5797cc1d897@mail.gmail.com> Date: Sat, 15 Dec 2007 14:33:00 -0000 From: "Grzegorz Cieslewski" To: gdb@sourceware.org Subject: Return value of program being debugged MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: de5c4b83e48c389a X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00103.txt.bz2 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 =====================================================