Hi Samuel! On 2020-05-29T13:46:50+0200, Samuel Thibault <samuel.thiba...@gnu.org> wrote: > libgcc is currently missing the support for unwinding over signal > trampolines on GNU/Hurd.
ACK. Has been on my long TODO list for a long time. ;-) > The attached patch implements it. Thanks! I'm not intimately familiar with the unwinding implementation, but your changes look quite what I'd have guessed they'd look like, and also somewhat similar to 'libgcc/config/i386/linux-unwind.h'. (I'll get there, eventually, again..., but) I'm not currently set up to test this, but I'll assume you have. Which GCC branches would you like this on? > --- /dev/null > +++ b/src/libgcc/config/i386/gnu-unwind.h > @@ -0,0 +1,107 @@ > + * i386 sigtramp frame we are looking for follows. > + * (see glibc/sysdeps/mach/hurd/i386/trampoline.c assembly) > + * > + * rpc_wait_trampoline: > + * 0: b8 e7 ff ff ff mov $-25,%eax mach_msg_trap > + * 5: 9a 00 00 00 00 07 00 lcall $7,$0 > + * 12: 89 01 movl %eax, (%ecx) > + * 14: 89 dc movl %ebx, %esp switch to signal > stack > + * > + * trampoline: > + * 16: ff d2 call *%edx call the handler > function > + * RA HERE > + * 18: 83 c4 0c addl $12, %esp pop its args > + * 21: c3 ret return to > sigreturn > + * > + * firewall: > + * 22: f4 hlt > + */ > + > + if (!( *(unsigned int *)(context->ra ) == 0xc30cc483 > + && *(unsigned char *)(context->ra + 4) == 0xf4 > + > + && *(unsigned int *)(context->ra - 4) == 0xd2ffdc89 > + && *(unsigned int *)(context->ra - 8) == 0x01890007 > + && *(unsigned int *)(context->ra - 12) == 0x00000000 > + && *(unsigned int *)(context->ra - 16) == 0x9affffff > + && *(unsigned short *)(context->ra - 18) == 0xe7b8)) > + return _URC_END_OF_STACK; Once we've got this in GCC, please then also cross-reference GCC's 'libgcc/config/i386/gnu-unwind.h' file in glibc's 'sysdeps/mach/hurd/i386/trampoline.c' file. Grüße Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter