17 questions
Advice
2
votes
4
replies
79
views
Under what circumstances will the frame pointer (`x29`) differ from the stack pointer (`sp`) on aarch64?
Obviously one such case they'll differ is when compiling with -fomit-frame-pointer, but let's assume I'm not interested in that trivial example.
Consider this C snippet:
uint64_t fib(uint64_t n) {
...
0
votes
1
answer
57
views
offcputime prints [unknown] frames for user stack
Someone filed a similar issue on GitHub: https://github.com/iovisor/bcc/issues/2657. But the issue has not been resolved for six years, so I ask the question here. Here is a minimum working example.
...
0
votes
1
answer
495
views
IDA Pro 9.1 displaying wrong values of local variables in locals window
Could you please advise on how to resolve the issue with variable display in the Locals window during debugging?
When execution is halted at a breakpoint at the beginning of a function, the variables ...
1
vote
0
answers
234
views
Force GCC not to optimize frame pointers even for leaf functions
I'm trying to build a production code and still have a minimum debugging capability, specially, in case of a processor trap. Critical information for me is to find the back trace causing the crash.
I'...
4
votes
1
answer
92
views
Where is the offset of the Y register from the call/stack frame in avr-gcc coming from?
On the avr-gcc website (https://gcc.gnu.org/wiki/avr-gcc#Frame_Layout) it says that the frame pointer (Y register) is off by one byte so Y+1 points to the bottom of the frame. However when I compiled ...
2
votes
1
answer
304
views
Arm64 Assembly: How to properly manage frame pointer?
I implemented recursive fibonacci as an exercise, and the program seems to work perfectly except for one thing: when stepping through the function with gdb, the "backtrace" command just ...
-1
votes
1
answer
316
views
What it means that Ebp register points to the old Ebp
i've been learning x86 assembly for reverse engineering recently and in my tutorial there is sentence that says Ebp points to the old Ebp, however i don't understand this, its confusing.
I looked up ...
1
vote
1
answer
160
views
Storing and Loading $ra
I'm currently having trouble writing this recursive factorial assembly code in MIPS. I do not want to change the format of this code, as it is for a project, but I want to understand how to store or ...
6
votes
0
answers
628
views
gdb use of the frame pointer register in Aarch64 assembly?
I've run into a surprise while using the gdb debugger to trace execution of an Aarch64 assembly-language program.
A lot of documentation equates the x29 "architectural register" with the ...
0
votes
0
answers
44
views
Passing arguments into an Assebly function [duplicate]
I'm trying to pass some arguments into a function but it doesn't get them correctly. I want to multiply some matrices and I want to pass: address of matrix 1, address of matrix 2, address of the ...
1
vote
1
answer
521
views
Why does the stack pointer and frame pointer have the same address?
I was under the impression that the frame pointer $fp is set to the first word of stack according to Computer Organization and Design MIPS 5th ed page 103.
int func(int g) {
int f = 9;
return ...
0
votes
1
answer
114
views
Is there a way to use popa/pusha without SP? (for procedures with BP)
for example:
var1 dw 8
var2 dw 1
res dw ?
CODESEG
proc plus
pusha
mov bp,sp
mov ax, [bp+6];var1
mov bx, [bp+4];var2
add ax, bx
mov [res], ax
popa
ret 4
endp plus
start :
mov ...
1
vote
0
answers
852
views
GDB disassembly, what is the -0xc(%rbp) position? [duplicate]
I am in school and doing an assignment where I disassembly binary files and then interpret them and build a C++ program from them (reverse engineering).
What does the "c" position represent ...
1
vote
1
answer
589
views
Is rbp/ebp(x86-64) register still used in conventional way?
I have been writing a small kernel lately based on x86-64 architecture. When taking care of some user space code, I realized I am virtually not using rbp. I then looked up at some other things and ...
74
votes
4
answers
177k
views
What are the ESP and the EBP registers?
I found that the ESP register is the current stack pointer and EBP is the base pointer for the current stack frame. However, I don't understand these definitions (I am just starting to learn how to ...