From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13795 invoked by alias); 15 Apr 2005 09:27:49 -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 13536 invoked from network); 15 Apr 2005 09:27:34 -0000 Received: from unknown (HELO post.ift.uib.no) (129.177.40.40) by sourceware.org with SMTP; 15 Apr 2005 09:27:34 -0000 Received: from termo1.fi.uib.no ([129.177.39.206] helo=termo1.fi.uib.no.ift.uib.no) by post.ift.uib.no with esmtp (Exim 3.36 #2) id 1DMN6o-0000kR-00; Fri, 15 Apr 2005 11:27:30 +0200 To: fedevaps@yahoo.dk Cc: gdb@sources.redhat.com Subject: Re: Still cannot print variable References: From: Joakim Hove Date: Fri, 15 Apr 2005 09:27:00 -0000 In-Reply-To: (fedevaps@yahoo.dk's message of "Fri, 15 Apr 2005 11:09:09 +0200") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-04/txt/msg00090.txt.bz2 JS writes: > I run "gdb test" followed by "print d" and then I get this error: You must explicitly start test with the run command from gdb: bash% gdb test <...> (gdb) run However, that is also not enough because the current program will immediately complete, and hence when you get back to the (gdb) prompt the context of the (no longer) running program is void. Hence you must set a breakpoint to halt the execution: bash% gdb test <...> (gdb) break test.c:5 # Break at line 5 in file test.c (gdb) run (gdb) print d HTH - Joakim -- Joakim Hove hove AT ift uib no / Tlf: +47 (55 5)8 27 90 / Stabburveien 18 Fax: +47 (55 5)8 94 40 / N-5231 Paradis http://www.ift.uib.no/~hove/ / 55 91 28 18 / 92 68 57 04