From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21663 invoked by alias); 16 Jul 2009 16:16:56 -0000 Received: (qmail 21655 invoked by uid 22791); 16 Jul 2009 16:16:55 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ax57.genwebserver.com (HELO ax57.genwebserver.com) (72.18.145.194) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jul 2009 16:16:50 +0000 Received: from hide-inside.nemetschek.net ([207.10.60.100] helo=[192.168.1.222]) by ax57.genwebserver.com with esmtpa (Exim 4.69) (envelope-from ) id 1MRTdY-0002Lg-Fv for gdb@sourceware.org; Thu, 16 Jul 2009 10:16:48 -0600 From: Eric Gorr Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: printing static const variables Date: Thu, 16 Jul 2009 16:16:00 -0000 Message-Id: <2C11E6EB-A5C0-4A12-8DC3-87E73C7755AC@ericgorr.net> To: gdb@sourceware.org Mime-Version: 1.0 (Apple Message framework v1071.1) 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: 2009-07/txt/msg00103.txt.bz2 I have a function which looks like: Boolean TestFunction( void ) { static const int doubleByteDegreeMark = 42; static int anotherVar = 12; return ( doubleByteDegreeMark == 42 && anotherVar == 12 ); } I set a breakpoint inside of this function and when it stops at this breakpoint, I do 'info locals' and it prints out: (gdb) info locals anotherVar = 12 if I try to print out the value of doubleByteDegreeMark, it gives me the error message: (gdb) print doubleByteDegreeMark No symbol "doubleByteDegreeMark" in current context. So, my (probably really simple) question is how can I print out the value of doubleByteDegreeMark from GDB? Thank you.