This question somehow relates to my previous question, but now I have a binary which is not stripped.
Let's say I have the following code snippet
QString my_variable("almafa"); qDebug() << my_variable;
Before calling the
<< operator I expect that either
rdi to contain the address of
my_variable. Correct me if I am wrong.
0x0000000000400aca <+100>: lea -0x60(%rbp),%rdx 0x0000000000400ace <+104>: lea -0x50(%rbp),%rax 0x0000000000400ad2 <+108>: mov %rdx,%rsi 0x0000000000400ad5 <+111>: mov %rax,%rdi 0x0000000000400ad8 <+114>: callq 0x400d40 <QDebug::operator<<(QString const&)>
strings a.out | grep my_variable returns
my_variable, so it is present in the executable. Is it somehow possible to ask
gdb (or any other linux debugger) what is the variable name which belongs to a given address?
my_variable is recognized by
gdb since command
print my_variable is working.