Reputation: 667
I am inspecting a process (which has no bugs actually) with gdb.
However I noticed, when doing info registers, that RSP
is higher than RBP
, which is not consistent with the fact that the stack grows downwards. Is this perhaps some optimization by the compiler?
rbp 0x7fabaf9ba290 0x7fabaf9ba290
rsp 0x7ffdf1ffa1b0 0x7ffdf1ffa1b0
Upvotes: 1
Views: 423
Reputation: 48672
There's no requirement that rbp
be used as a frame pointer. When -fomit-frame-pointer
is active, as is the default in optimized programs, it's just used the same as any other call-saved register (e.g., rbx
).
Upvotes: 3