Changeset 84207844e7c0a51fbe16693ead8698c1db0e1b4f
- Timestamp:
- 05/30/08 18:03:26
(3 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1212163406 +0200
- git-parent:
[3a2e925ec784fad9370cdebdf28fca22a2fb3517]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1212163390 +0200
- Message:
libvlccore: Also print a backtrace on Mac OS X.
Note: We may want to check that at configure time.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r234a17d |
r8420784 |
|
| 1489 | 1489 | |
|---|
| 1490 | 1490 | #ifndef NDEBUG |
|---|
| 1491 | | # ifdef __GLIBC__ |
|---|
| | 1491 | # if defined(__GLIBC__) || defined(__APPLE__) |
|---|
| 1492 | 1492 | # include <execinfo.h> |
|---|
| 1493 | 1493 | # endif |
|---|
| … | … | |
| 1548 | 1548 | fflush (stderr); |
|---|
| 1549 | 1549 | |
|---|
| 1550 | | #ifdef __GLIBC__ |
|---|
| | 1550 | #if defined(__GLIBC__) || defined(__APPLE__) |
|---|
| 1551 | 1551 | void *stack[20]; |
|---|
| 1552 | 1552 | int stackdepth = backtrace (stack, sizeof (stack) / sizeof (stack[0])); |
|---|
| r3f14ac4 |
r8420784 |
|
| 84 | 84 | } |
|---|
| 85 | 85 | |
|---|
| 86 | | #ifdef __GLIBC__ |
|---|
| | 86 | #if defined(__GLIBC__) || defined(__APPLE__) |
|---|
| 87 | 87 | # include <execinfo.h> |
|---|
| 88 | 88 | #endif |
|---|
| … | … | |
| 106 | 106 | errno = error; |
|---|
| 107 | 107 | dprintf (2, " Error message: %m at:\n"); |
|---|
| 108 | | |
|---|
| 109 | | void *stack[20]; |
|---|
| 110 | | int len = backtrace (stack, sizeof (stack) / sizeof (stack[0])); |
|---|
| 111 | | backtrace_symbols_fd (stack, len, 2); |
|---|
| 112 | 108 | #else |
|---|
| 113 | 109 | char buf[1000]; |
|---|
| … | … | |
| 128 | 124 | fprintf (stderr, " Error message: %s\n", msg); |
|---|
| 129 | 125 | fflush (stderr); |
|---|
| | 126 | #endif |
|---|
| | 127 | |
|---|
| | 128 | #if defined(__GLIBC__) || defined(__APPLE__) |
|---|
| | 129 | void *stack[20]; |
|---|
| | 130 | int len = backtrace (stack, sizeof (stack) / sizeof (stack[0])); |
|---|
| | 131 | backtrace_symbols_fd (stack, len, 2); |
|---|
| 130 | 132 | #endif |
|---|
| 131 | 133 | |
|---|