1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-26 11:21:44 +02:00

Provide proper offsets for gregs in freebsd ucontext. Note that fp regs are not handled.

This commit is contained in:
Konstantin Belousov 2010-03-06 22:33:11 +02:00
parent 63ae8ca894
commit 62218e10eb

View file

@ -22,6 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#if defined __linux__
#define UC_MCONTEXT_GREGS_R8 0x28
#define UC_MCONTEXT_GREGS_R9 0x30
#define UC_MCONTEXT_GREGS_R10 0x38
@ -42,3 +43,25 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define UC_MCONTEXT_FPREGS_PTR 0x1a8
#define UC_MCONTEXT_FPREGS_MEM 0xe0
#define FPREGS_OFFSET_MXCSR 0x18
#elif defined __FreeBSD__
#define UC_MCONTEXT_GREGS_R8 0x38
#define UC_MCONTEXT_GREGS_R9 0x40
#define UC_MCONTEXT_GREGS_R10 0x60
#define UC_MCONTEXT_GREGS_R11 0x68
#define UC_MCONTEXT_GREGS_R12 0x70
#define UC_MCONTEXT_GREGS_R13 0x78
#define UC_MCONTEXT_GREGS_R14 0x80
#define UC_MCONTEXT_GREGS_R15 0x88
#define UC_MCONTEXT_GREGS_RDI 0x18
#define UC_MCONTEXT_GREGS_RSI 0x20
#define UC_MCONTEXT_GREGS_RBP 0x58
#define UC_MCONTEXT_GREGS_RBX 0x50
#define UC_MCONTEXT_GREGS_RDX 0x28
#define UC_MCONTEXT_GREGS_RAX 0x48
#define UC_MCONTEXT_GREGS_RCX 0x30
#define UC_MCONTEXT_GREGS_RSP 0xa0
#define UC_MCONTEXT_GREGS_RIP 0xb0
#define UC_MCONTEXT_FPREGS_PTR 0x1a8 /* XXXKIB */
#define UC_MCONTEXT_FPREGS_MEM 0xe0 /* XXXKIB */
#define FPREGS_OFFSET_MXCSR 0x18 /* XXXKIB */
#endif