The 06/08/2020 09:12, Luis Machado wrote: > Hi Szabolcs, > > Just to confirm, this is a "unwinder debugger hook ABI" change only in the > sense that the generated DWARF will be changed, right? So no further action > from DWARF consumers will be needed. Is that understanding correct?
the _Unwind_DebugHook can currently be called with a handler argument that's signed (see below), i don't know how gdb uses this api (e.g. if it uses DWARF info to check if the argument is signed), but i plan to change all apis not to pass signed pointers around since they can cause ABI issues. (the debugger is special in that it has to know about pointer auth anyway so it's not critical to change this api, but i think it's better to do for consistency) > On 6/5/20 1:51 PM, Szabolcs Nagy wrote: > > Mangling, currently only used on AArch64 for return address signing, > > is an internal representation that should not be exposed via > > > > __builtin_return_address return value, > > __builtin_eh_return handler argument, > > _Unwind_DebugHook handler argument. ... > > -static inline void * > > -uw_frob_return_addr (struct _Unwind_Context *current > > - __attribute__ ((__unused__)), > > - struct _Unwind_Context *target) > > -{ > > - void *ret_addr = __builtin_frob_return_addr (target->ra); > > -#ifdef MD_POST_FROB_EH_HANDLER_ADDR > > - ret_addr = MD_POST_FROB_EH_HANDLER_ADDR (current, target, ret_addr); > > -#endif > > - return ret_addr; > > -} > > - > > /* Install TARGET into CURRENT so that we can return to it. This is a > > macro because __builtin_eh_return must be invoked in the context of > > our caller. FRAMES is a number of frames to be unwind. > > @@ -1667,7 +1649,7 @@ uw_frob_return_addr (struct _Unwind_Context *current > > do > > \ > > { > > \ > > long offset = uw_install_context_1 ((CURRENT), (TARGET)); > > \ > > - void *handler = uw_frob_return_addr ((CURRENT), (TARGET)); \ > > + void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ > > _Unwind_DebugHook ((TARGET)->cfa, handler); \ > > _Unwind_Frames_Extra (FRAMES); > > \ > > __builtin_eh_return (offset, handler); > > \ handler is no longer signed after my patch. (if signing is necessary then __builtin_eh_return should deal with that.)