From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7306 invoked by alias); 30 Mar 2005 09:28:51 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7215 invoked from network); 30 Mar 2005 09:28:38 -0000 Received: from unknown (HELO mail.netspace.net.au) (203.10.110.71) by sourceware.org with SMTP; 30 Mar 2005 09:28:38 -0000 Received: from [192.168.1.11] (220-253-3-149.VIC.netspace.net.au [220.253.3.149]) by mail.netspace.net.au (Postfix) with ESMTP id 9F24C4364C for ; Wed, 30 Mar 2005 19:28:34 +1000 (EST) Message-ID: <424A71F7.2090407@netspace.net.au> Date: Wed, 30 Mar 2005 09:28:00 -0000 From: Russell Shaw User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 MIME-Version: 1.0 Cc: gdb@sources.redhat.com Subject: Re: Print variable with gdb?? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-03/txt/msg00298.txt.bz2 JS wrote: > I have: > > int p = 5; > > when I debug my code I would like to get a print of p's value therefore I > start gdb and type: > > print p > > but then I get an error that the variable does not exists! > > Hope someone can help! > > JS Type "start" so it runs to main(). print p should work if p is in scope.