From 107f81314155383ab9c0625f3d157be55131f837 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 16 Jul 1998 20:08:44 +0000 Subject: Update. 1998-07-16 20:01 Ulrich Drepper * debug/Makefile (routines): Add backtracesymsfd. Add rules to generate libSegFault. * debug/Versions: Add __backtrace_symbols_fd and backtrace_symbols_fd. * debug/execinfo.h: Declare backtrace_symbols_fd. * sysdeps/generic/backtracesymsfd.c: New file. * sysdeps/generic/elf/backtracesymsfd.c: New file. * sysdeps/generic/segfault.c: New file. * sysdeps/generic/sigcontextinfo.h: New file. * sysdeps/unix/sysv/linux/i386/sigcontextinfo.h: New file. * sysdeps/generic/elf/backtracesyms.c: Remove unneeded +. --- debug/Makefile | 13 ++++++++++++- debug/Versions | 4 ++-- debug/execinfo.h | 9 +++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) (limited to 'debug') diff --git a/debug/Makefile b/debug/Makefile index 5286cc1..3ee7a9f 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -23,10 +23,21 @@ subdir := debug headers := execinfo.h -routines := backtrace backtracesyms +routines := backtrace backtracesyms backtracesymsfd CFLAGS-backtrace.c = -fno-omit-frame-pointer tests = backtrace-tst +extra-libs = libSegFault +extra-libs-others = $(extra-libs) + +libSegFault-routines = segfault +libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes)) + include ../Rules + +# Depend on libc.so so a DT_NEEDED is generated in the shared objects. +# This ensures they will load libc.so for needed symbols if loaded by +# a statically-linked program that hasn't already loaded it. +$(objpfx)libSegFault.so: $(common-objpfx)libc.so $(common-objpfx)elf/ld.so diff --git a/debug/Versions b/debug/Versions index 28518d5..01d390e 100644 --- a/debug/Versions +++ b/debug/Versions @@ -1,9 +1,9 @@ libc { GLIBC_2.1 { # functions used in other libraries - __backtrace; __backtrace_symbols; + __backtrace; __backtrace_symbols; __backtrace_symbols_fd; # b* - backtrace; backtrace_symbols; + backtrace; backtrace_symbols; backtrace_symbols_fd; } } diff --git a/debug/execinfo.h b/debug/execinfo.h index bf757ed..9e0e551 100644 --- a/debug/execinfo.h +++ b/debug/execinfo.h @@ -34,6 +34,15 @@ extern int backtrace __P ((void **__array, int __size)); extern char **__backtrace_symbols __P ((void *__const *__array, int __size)); extern char **backtrace_symbols __P ((void *__const *__array, int __size)); + +/* This function is similar to backtrace_symbols() but it writes the result + immediately to a file and can therefore also be used in situations where + malloc() is not usable anymore. */ +extern void __backtrace_symbols_fd __P ((void *__const *__array, int __size, + int __fd)); +extern void backtrace_symbols_fd __P ((void *__const *__array, int __size, + int __fd)); + __END_DECLS #endif /* execinfo.h */ -- cgit v1.1