summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-07-16 20:08:44 +0000
committerUlrich Drepper <drepper@redhat.com>1998-07-16 20:08:44 +0000
commit107f81314155383ab9c0625f3d157be55131f837 (patch)
tree8269ce62db3039a86c13b0c090691081fbf8797c /debug
parent7a2fd787a7aa4de58b9e3db5fe996f5ea89a3180 (diff)
downloadglibc-107f81314155383ab9c0625f3d157be55131f837.tar.gz
Update.
1998-07-16 20:01 Ulrich Drepper <drepper@cygnus.com> * 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 +.
Diffstat (limited to 'debug')
-rw-r--r--debug/Makefile13
-rw-r--r--debug/Versions4
-rw-r--r--debug/execinfo.h9
3 files changed, 23 insertions, 3 deletions
diff --git a/debug/Makefile b/debug/Makefile
index 5286cc15fd..3ee7a9f94d 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 28518d5084..01d390eb9f 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 bf757edf77..9e0e551a4a 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 */