[Lldb-commits] [PATCH] D22266: Add "support" for DW_CFA_GNU_args_size to the unwinder
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 13 04:13:30 PDT 2016
labath added a comment.
In http://reviews.llvm.org/D22266#482626, @jasonmolenda wrote:
> This is fine - is there a binary using this? I'd love to see the assembly code and a dump of the eh_frame CFI.
> I googled around and didn't find much about DW_CFA_GNU_args_size but in the libunwind llvm sources (v. https://llvm.org/svn/llvm-project/libunwind/trunk/src/ ) it takes the uleb value and adjusts the stack pointer by that value?? I don't see why that wouldn't be encoded in the normal "CFA is sp + offset" type rule of eh_frame so it must not be quite that simple. lldb will probably unwind incorrectly if code built frameless (not using a frame pointer register) is encountered.
That's pretty much what I was able to figure out as well. I haven't managed to understand it's purpose either.
GCC 4.9 seems to produce this instruction fairly liberally. However, I was unable to get it to produce this instruction in an esp-based frame (which could mean that we don't need to handle it? I don't know..) In any case, I am attaching a reduced object file demonstrating it's use of this function F2161596: thread.o <http://reviews.llvm.org/F2161596>, so you should be able to get all the info you requested from it. If you are able to help us with this, it would be very appreciated. Let me know if there is anything else I can do to help you with that.
For reference, the approximate source code of the function which produced that attribute is:
extern "C" void*
thread::_Impl_base* __t = static_cast<thread::_Impl_base*>(__p);
More information about the lldb-commits