1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-27 21:43:42 +01:00
libunwind-eh_elf/src
Dave Watson 4b63a536ee dwarf: Correct handling of DW_CFA_GNU_args_size
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)
2017-01-13 08:28:21 -08:00
..
aarch64 Fixup invalid return code checks of unw_is_signal_frame() 2017-01-13 08:27:40 -08:00
arm Fixup invalid return code checks of unw_is_signal_frame() 2017-01-13 08:27:40 -08:00
coredump coredump: align coredump description pointer 2017-01-13 08:28:21 -08:00
dwarf dwarf: Correct handling of DW_CFA_GNU_args_size 2017-01-13 08:28:21 -08:00
hppa One time whitespace fixup. 2014-09-27 09:47:23 -07:00
ia64 One time whitespace fixup. 2014-09-27 09:47:23 -07:00
mi Add an option to have start_ip_offset be relative to start_ip 2015-09-15 12:18:30 -07:00
mips tdep_uc_addr: use +4 offset for UNW_MIPS_PC on MIPS (be) 2017-01-13 08:27:40 -08:00
ppc powerpc64 implementation 2015-09-07 18:08:26 -07:00
ppc32 Fixup invalid return code checks of unw_is_signal_frame() 2017-01-13 08:27:40 -08:00
ppc64 Fixup invalid return code checks of unw_is_signal_frame() 2017-01-13 08:27:40 -08:00
ptrace One time whitespace fixup. 2014-09-27 09:47:23 -07:00
setjmp One time whitespace fixup. 2014-09-27 09:47:23 -07:00
sh Fixup invalid return code checks of unw_is_signal_frame() 2017-01-13 08:27:40 -08:00
tilegx Fixup invalid return code checks of unw_is_signal_frame() 2017-01-13 08:27:40 -08:00
unwind One time whitespace fixup. 2014-09-27 09:47:23 -07:00
x86 dwarf: Correct handling of DW_CFA_GNU_args_size 2017-01-13 08:28:21 -08:00
x86_64 dwarf: Correct handling of DW_CFA_GNU_args_size 2017-01-13 08:28:21 -08:00
elf32.c Do nothing of UNW_REMOTE_ONLY is defined. 2003-02-15 03:10:30 +00:00
elf32.h One time whitespace fixup. 2014-09-27 09:47:23 -07:00
elf64.c Do nothing of UNW_REMOTE_ONLY is defined. 2003-02-15 03:10:30 +00:00
elf64.h One time whitespace fixup. 2014-09-27 09:47:23 -07:00
elfxx.c One time whitespace fixup. 2014-09-27 09:47:23 -07:00
elfxx.h One time whitespace fixup. 2014-09-27 09:47:23 -07:00
libunwind-generic.pc.in Add Cflags keyword to pkg-config metadata files 2013-08-26 05:40:19 -07:00
Makefile.am Merge branch 'fast-stack-trace-arm' of https://github.com/fillexen/libunwind 2014-09-20 08:09:55 -07:00
os-freebsd.c One time whitespace fixup. 2014-09-27 09:47:23 -07:00
os-hpux.c One time whitespace fixup. 2014-09-27 09:47:23 -07:00
os-linux.c One time whitespace fixup. 2014-09-27 09:47:23 -07:00
os-linux.h One time whitespace fixup. 2014-09-27 09:47:23 -07:00
os-qnx.c One time whitespace fixup. 2014-09-27 09:47:23 -07:00