This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Address of variable doesn't work (ARM-ELF 4.18)?
- To: Grant Edwards <grante at visi dot com>
- Subject: Re: Address of variable doesn't work (ARM-ELF 4.18)?
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 27 Jan 2000 15:41:15 +0000
- Cc: gdb at sourceware dot cygnus dot com
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
grante@visi.com said:
> Using arm-elf-gdb 4.18, how do I get gdb to print the address of a
> variable or to use the address of a variable as the argument for an
> 'x' command?
Info address should give you what you want, and a lot more besides. It
works even if the symbol you have asked for is in a register.
(gdb) info address main
Symbol "main" is a function at address 0x3b064.
(gdb) info address optimize
Symbol "optimize" is static storage at address 0x3214d4.
(gdb) info address argc
Symbol "argc" is an argument at offset 68.
(gdb) info address p
Symbol "p" is a local variable at frame offset -20.
(gdb) info address c
Symbol "c" is a variable in register l0.
Richard.