Re: Find out function arguments value from stack pointer

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

 




在 2012-12-12,19:28,"Manavendra Nath Manav" <mnm.kernel@xxxxxxxxx> 写道:

> On Wed, Dec 12, 2012 at 4:38 PM, Fabio Pozzi <pozzi.fabio@xxxxxxxxx> wrote:
>>> When i call  print values at offsets starting from
>>> __builtin_frame_address (0) the function arguments start from offset
>>> 2. How can I confirm that this behavior is always consistent.
>> 
>> Arguments are pushed on the stack before the saved frame pointer, thus
>> you have to add an offset equal to the frame pointer address size if
>> you start from the beginning of the saved frame pointer record on the
>> stack.
> 
> Thanks Fabio!
> If I execute the same code on ARM arch, does it needs any changes?
> 

Arm does not use stack to pass parameters when parameters are less than 4, it uses registers r0 to r3 to pass parameters, and at the beginning of subroutine, r0 to r3 are not stored on stack. So it is complicated to find out parameters from stack as I know.


> -- 
> Manavendra Nath Manav
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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