I will narrow down my questions:
The entry address in GDB stays the same for the same program (even after reboot, and after rewriting the source code).
Why is that?
For example 0x80483f4 is the starting address.
**0x80483f4** <main()> push %ebp │
│0x80483f5 <main()+1> mov %esp,%ebp │
│0x80483f7 <main()+3> sub $0x10,%esp │
│0x80483fa <main()+6> movl $0x3,-0x4(%ebp) │
│0x8048401 <main()+13> movl $0x3,-0x8(%ebp) │
│0x8048408 <main()+20> mov $0x0,%eax │
│0x804840d <main()+25> leave │
│0x804840e <main()+26> ret
Beside that, the value we get from, let say, 0x80483fa, is always the same.
$2 = 0x80483fa <main()+6>
(gdb) x $2
0x80483fa <main()+6>: 0x3fc45c7
(gdb) p 0x3fc45c7
$3 = 66864583 <-- even after reboot.
What does this suggest me?
I am interested in the values before and after each assignment (say c = a+b later), without using breakpoints to step through one line at a time.
The source code:
int main()
{
int b = 3;
int a = 3;
return 0;
}
Can someone please explain this to me? Thanks. (I would also mark this as homework, although it really isn't.)