From 542493f93c68755e0c005309e061d5a5a42142ac Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 6 Jan 2000 00:10:15 +0000 Subject: Update. 2000-01-05 Philip Blundell * sysdeps/arm/frame.h: New file. * sysdeps/generic/frame.h: Likewise. * sysdeps/generic/segfault.c (struct layout): Delete definition; include the above file instead. * sysdeps/generic/backtrace.c (struct layout): Likewise. (__backtrace): Use ADVANCE_STACK_FRAME. * sysdeps/unix/sysv/linux/arm/sigcontextinfo.h (ADVANCE_STACK_FRAME): New macro. (GET_FRAME): Apply above to returned value. * sysdeps/unix/sysv/linux/arm/bits/armsigctx.h: Add `fault_address'. --- sysdeps/unix/sysv/linux/arm/bits/armsigctx.h | 9 ++++++++- sysdeps/unix/sysv/linux/arm/sigcontextinfo.h | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h b/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h index 3435a961bc..636a93bd95 100644 --- a/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h +++ b/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h @@ -1,5 +1,5 @@ /* Definition of `struct sigcontext' for Linux/ARM - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,12 @@ Fortunately 2.0 puts a magic number in the first word and this is not a legal value for `trap_no', so we can tell them apart. */ +/* Early 2.2 and 2.3 kernels do not have the `fault_address' member in + the sigcontext structure. Unfortunately there is no reliable way + to test for its presence and this word will contain garbage for too-old + kernels. Versions 2.2.14 and 2.3.35 (plus later versions) are known to + include this element. */ + #ifndef __ARMSIGCTX_H #define __ARMSIGCTX_H 1 @@ -50,6 +56,7 @@ union k_sigcontext unsigned long int arm_lr; unsigned long int arm_pc; unsigned long int arm_cpsr; + unsigned long fault_address; } v21; struct { diff --git a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h index 7f6ecbdee1..1aaca1e155 100644 --- a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h +++ b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h @@ -24,7 +24,10 @@ #define GET_PC(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \ ctx.v20.reg.ARM_pc : ctx.v21.arm_pc)) -#define GET_FRAME(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \ +#define GET_FRAME(ctx) \ + ADVANCE_STACK_FRAME((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \ ctx.v20.reg.ARM_fp : ctx.v21.arm_fp)) #define GET_STACK(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \ ctx.v20.reg.ARM_sp : ctx.v21.arm_sp)) +#define ADVANCE_STACK_FRAME(frm) \ + ((struct layout *)frm - 1) -- cgit v1.2.3-70-g09d2