Re: anyone understands CFI_ADJUST_CFA_OFFSET ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22-11-07 19:35, Ramagudi Naziir wrote:

taking a look at the system_call handler (entry_32.S), I saw that after
every push to the stack the directive CFI_ADJUST_CFA_OFFSET 4 is used,
and after every pop there is a CFI_ADJUST_CFA_OFFSET -4.

why is that ?

These only exist for inserting some debugging information which normally a compiler would (could) take care of. CFI stands for Call Frame Information and helps a debugger create a reliable backtrace through functions.

This has potential value for looking at the kernel with debuggers such as GDB and NLKD and potential value inside the kernel itself when somebody ports a DWARF unwinder to the kernel proper (DWARF is the debugging format CFI is a part of) which google shows some are contemplating.

If you look at CFI_ADJUST_CFA_OFFSET you see it turn into an assembler pesudo op that you could, as it advices, learn more about in info as.

You also see that without CONFIG_UNWIND_INFO, they turn into whitespace and given that at least currently CONFIG_UNWIND_INFO is a dead config variable you may conclude that it's currently fairly safe not too worry about them. Robert Day tried to remove the macro defintions a while ago it seems so he may have further information in the form of people telling him why they wanted them to stay.

when do I have to put those directives after push and pop ?

When programking in pure assembly and after they've promoted themselves from no-op's to something substantial. Perhaps.

Rene.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux