When trying to debug some simple code, I could not get GDB to identify a local variable from a memory address with info symbol.
The code was compiled using g++ -g3 -Wall -Wextra.
int main()
{
    int foo = 1234;
    return foo;
}
(gdb) p foo
$1 = 1234
(gdb) p &foo
$2 = (int *) 0x7fffffffd7c4
(gdb) info symbol 0x7fffffffd7c4
No symbol matches 0x7fffffffd7c4.
(gdb) info address foo
Symbol "foo" is a complex DWARF expression:
     0: DW_OP_fbreg -28
.
Why can't GDB identify the variable in this case? Does info symbol only work for global objects?
 
    