aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/backtrace.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-06 00:10:15 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-06 00:10:15 +0000
commit542493f93c68755e0c005309e061d5a5a42142ac (patch)
tree7abc952b75cef5d4c9d31973e9f3826ea5a173b0 /sysdeps/generic/backtrace.c
parentf3ac48d0deccc3cab889ac91e4ba9c46b09ae9b3 (diff)
downloadglibc-542493f93c68755e0c005309e061d5a5a42142ac.tar
glibc-542493f93c68755e0c005309e061d5a5a42142ac.tar.gz
glibc-542493f93c68755e0c005309e061d5a5a42142ac.tar.bz2
glibc-542493f93c68755e0c005309e061d5a5a42142ac.zip
Update.
2000-01-05 Philip Blundell <philb@gnu.org> * 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'.
Diffstat (limited to 'sysdeps/generic/backtrace.c')
-rw-r--r--sysdeps/generic/backtrace.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/generic/backtrace.c b/sysdeps/generic/backtrace.c
index 2d329e19cf..3eae3f44f7 100644
--- a/sysdeps/generic/backtrace.c
+++ b/sysdeps/generic/backtrace.c
@@ -19,7 +19,8 @@
Boston, MA 02111-1307, USA. */
#include <execinfo.h>
-
+#include <frame.h>
+#include <sigcontextinfo.h>
/* This is a global variable set at program start time. It marks the
highest used stack address. */
@@ -49,11 +50,11 @@ extern void *__libc_stack_end;
# define INNER_THAN <
#endif
-struct layout
-{
- struct layout *next;
- void *return_address;
-};
+/* By default assume the `next' pointer in struct layout points to the
+ next struct layout. */
+#ifndef ADVANCE_STACK_FRAME
+# define ADVANCE_STACK_FRAME(next) ((struct layout *) (next))
+#endif
int
__backtrace (array, size)
@@ -81,7 +82,7 @@ __backtrace (array, size)
array[cnt++] = current->return_address;
- current = current->next;
+ current = ADVANCE_STACK_FRAME (current->next);
}
return cnt;