Supported on windows
Supported on linux
Supported on embedded
Supported on android

info address command

Displays the address of a given symbol

Syntax

info address [Symbol name]

Parameters

Symbol name
Specifies the symbol (function or variable) which address should be displayed.

Remarks

The info address command produces similar output to the print & command. However, unlike the print command it does not display the type information, but prints whether the symbol is a function or a variable.

Note that the program does not need to be running in order to use the info address command.

In order to do the reverse operation (get a symbol name from address), use the info symbol command.

Examples

We will demonstrate the use of the info address command using a basic C++ program consisting of a main() function and a global variable. We will show the output of the info address command and the output of an equivalent print command:

(gdb) info address main
Symbol "main(int, char**)" is a function at address 0x804841d.
(gdb) info address g_GlobalVar
Symbol "g_GlobalVar" is static storage at address 0x804a020.
(gdb) print &main
$1 = (int (*)(int, char **)) 0x804841d <main(int, char**)>
(gdb) print &g_GlobalVar
$2 = (int *) 0x804a020 <g_GlobalVar>

Compatibility with VisualGDB

You can execute the info address command under VisualGDB using the GDB Session window in Visual Studio.

See also