0.9.4.19:
authorJuho Snellman <jsnell@iki.fi>
Wed, 31 Aug 2005 14:52:22 +0000 (14:52 +0000)
committerJuho Snellman <jsnell@iki.fi>
Wed, 31 Aug 2005 14:52:22 +0000 (14:52 +0000)
Show foreign function names in LDB stacktraces when
        LISP_FEATURE_OS_PROVIDES_DLADDR.

src/runtime/backtrace.c
tests/run-tests.lisp
version.lisp-expr

index 624ffcf..471e84d 100644 (file)
 #include "genesis/primitive-objects.h"
 #include "thread.h"
 
+#ifdef LISP_FEATURE_OS_PROVIDES_DLADDR
+/* __USE_GNU needed if we want dladdr() and Dl_Info from glibc. */
+#define __USE_GNU
+#include "dlfcn.h"
+#endif
+
 #if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
 
 /* KLUDGE: Sigh ... I know what the call frame looks like and it had
@@ -481,10 +487,20 @@ backtrace(int nframes)
         print_entry_name(df->name);
       else
         print_entry_points(cp);
-    } else
-      printf("Foreign fp = 0x%lx, ra = 0x%lx",
-             (unsigned long) next_fp,
-             (unsigned long) ra);
+    } else {
+#ifdef LISP_FEATURE_OS_PROVIDES_DLADDR
+        Dl_info info;
+        if (dladdr(ra, &info)) {
+            printf("Foreign function %s, fp = 0x%lx, ra = 0x%lx",
+                   info.dli_sname,
+                   (unsigned long) next_fp,
+                   (unsigned long) ra);
+        } else
+#endif
+        printf("Foreign fp = 0x%lx, ra = 0x%lx",
+               (unsigned long) next_fp,
+               (unsigned long) ra);
+    }
 
     putchar('\n');
     fp = next_fp;
index cc1adc6..c1d4f15 100644 (file)
   (setf *all-failures* (append failures *all-failures*)))
 
 (defun unexpected-failures ()
-  (remove-if (lambda (x) 
-                (or (eq (car x) :expected-failure) 
-                   (eq (car x) :unexpected-success)))
+  (remove-if (lambda (x)
+               (or (eq (car x) :expected-failure)
+                   (eq (car x) :unexpected-success)))
              *all-failures*))
 
 (defun setup-cl-user ()
index e715610..3025ea7 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.4.18"
+"0.9.4.19"