Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Eric Gorr <mailist@ericgorr.net>
To: gdb@sourceware.org
Subject: printing static const variables
Date: Thu, 16 Jul 2009 16:16:00 -0000	[thread overview]
Message-ID: <2C11E6EB-A5C0-4A12-8DC3-87E73C7755AC@ericgorr.net> (raw)

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.



             reply	other threads:[~2009-07-16 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 16:16 Eric Gorr [this message]
2009-07-16 16:21 ` Tom Tromey
2009-07-16 16:35   ` Eric Gorr
2009-07-16 16:56     ` Tom Tromey
2009-07-16 17:28     ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2C11E6EB-A5C0-4A12-8DC3-87E73C7755AC@ericgorr.net \
    --to=mailist@ericgorr.net \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox