mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-27 21:43:42 +01:00
4b63a536ee
When resuming execution, DW_CFA_GNU_args_size from the current frame must be added back to the stack pointer. Clang now generates these frequently at -O3. A simple repro for x86_64, that will crash with clang ~3.9 or newer: void f(int, int,int,int,int,int,int,int,int); int main() { try { f(0,1,2,3,4,5,6,7,8); } catch (int) { return 0; } return 1; } Where f is something that throws an int, but in a different translation unit to prevent optimization. This results in cfi instructions before the call: .cfi_escape 0x2e, 0x20 Grabbing the args_size means fully parsing the cfi in the current frame, which is unfortunate because it means nearly twice the work at each step. The logic to grab args_size can be in unw_step or get_proc_info (since this is always called before resuming in stack unwinding). Putting it in get_proc_info allows the more common unw_step code to remain fast. It would potentially fit in nicely with a proc info cache (as mentioned in the if0 comment block) |
||
---|---|---|
.. | ||
aarch64 | ||
arm | ||
coredump | ||
dwarf | ||
hppa | ||
ia64 | ||
mi | ||
mips | ||
ppc | ||
ppc32 | ||
ppc64 | ||
ptrace | ||
setjmp | ||
sh | ||
tilegx | ||
unwind | ||
x86 | ||
x86_64 | ||
elf32.c | ||
elf32.h | ||
elf64.c | ||
elf64.h | ||
elfxx.c | ||
elfxx.h | ||
libunwind-generic.pc.in | ||
Makefile.am | ||
os-freebsd.c | ||
os-hpux.c | ||
os-linux.c | ||
os-linux.h | ||
os-qnx.c |