Date: Tue, 7 Feb 2017 19:42:33 -0600 From: John Marino <freebsdml@marino.st> To: Andrew Turner <andrew@fubar.geek.nz> Cc: freebsd-arm@freebsd.org, Andreas Tobler <andreastt@gmail.com> Subject: Re: ARM64: PC/IP not saved in signal frame Message-ID: <cc9ba311-e9a2-8c1e-51a3-e1d8cad6de9c@marino.st> In-Reply-To: <20170207190622.1a7a3673@zapp> References: <530c18cd-d50d-4709-a0ca-22324a0cb592@marino.st> <86279411-3979-edab-7ba2-4a1e3fa6429e@marino.st> <20170207190622.1a7a3673@zapp>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2/7/2017 13:06, Andrew Turner wrote: > On Tue, 7 Feb 2017 12:55:51 -0600 > John Marino <freebsdml@marino.st> wrote: > >> On 2/7/2017 12:47, John Marino wrote: >>> Hi guys, >>> I've been struggling to provide unwind support on the >>> aarch64-*-freebsd* target of FreeBSD. The only working example on >>> this arch is aarch64-linux (attached). I think I'm 99% done with >>> the freebsd version (attached) but the last value that needs to be >>> pass to the _Unwind_FrameState is the program counter offset. >>> >>> I know the PC is not register-based on aarch64. Linux still saves >>> the value in the signal context, but AFAICT FreeBSD does not. >>> >>> Can somebody >>> A) confirm that the program counter is missing from the saved signal >>> context >>> B) confirm that it needs to be added for proper signal frame >>> unwinding? >>> >>> Alternatively, maybe somebody can figure out a solution given the >>> current freebsd structures, but I'm losing hope on that one. (line >>> 99) >> >> Apparently attachments are stripped out on this mail list. >> You can see the headers here: >> https://leaf.dragonflybsd.org/~marino/linux-unwind.h >> https://leaf.dragonflybsd.org/~marino/freebsd-unwind.h > > You want sc->REG_NAME(elr). > Hi Andrew, After changing the .how field to REG_SAVED_OFFSET (from the original REG_SAVED_VAL_OFFSET) on the retaddr column, it worked! I didn't expect that though. Is linux just using a misnomer? That is, is it referring to the Exception Link Register as the PC? I'm just trying to understand what happened and how you knew the correct answer. :) John
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cc9ba311-e9a2-8c1e-51a3-e1d8cad6de9c>