Answer the question
In order to leave comments, you need to log in
What is this piece of code for?
In the assembler code at the beginning of the function description, there is such a piece of code, what is it responsible for?
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
Answer the question
In order to leave comments, you need to log in
This is the organization of the stack frame: pushq %rbp saves the current stack frame pointer, movq %rsp, %rbp sets a new one.
Annotations starting with .cfi_ control the debugging information used by the debugger and the stack unwinding mechanism on exceptions:
.cfi_startproc sets the start of the procedure and sets the start register and offset for calculating the CFA (Canonical Frame Address).
.cfi_def_cfa_offset 16 updates the CFA offset to be 16 relative to the register (%rsp) specified (by the .cfi_startproc directive).
.cfi_offset 6, -16 says that register 6 is now at offset -16 from CFA (thus the pushq %rbp instruction was described).
.cfi_def_cfa_register 6 says that register 6 is now used to calculate the CFA address.
Details about .cfi_ can be found in info as and the big picture in chapter 6.4 of the DWARF standard .
en.wikibooks.org/wiki/X86_Disassembly/Functions_an... - I think it's
Only your assembler is kind of strange :-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question