60 return (
void *) (uintptr_t) (
f2 (__LINE__) - 2);
66 return f3 (f1line, __LINE__) + 2;
70f3 (
int f1line,
int f2line)
82 f3line = __LINE__ + 1;
87 fprintf (stderr,
"test1: unexpected return value %d\n", i);
94 "test1: not enough frames; got %zu, expected at least 3\n",
99 check (
"test1", 0,
all, f3line,
"f3",
"ttest.c", &
data.failed);
100 check (
"test1", 1,
all, f2line,
"f2",
"ttest.c", &
data.failed);
101 check (
"test1", 2,
all, f1line,
"test1_thread",
"ttest.c", &
data.failed);
108#define THREAD_COUNT 10
123 errnum = pthread_create (&atid[i], NULL, test1_thread, NULL);
126 fprintf (stderr,
"pthread_create %d: %s\n", i, strerror (errnum));
134 errnum = pthread_join (atid[i], &ret);
137 fprintf (stderr,
"pthread_join %d: %s\n", i, strerror (errnum));
140 this_fail += (int) (uintptr_t) ret;
143 printf (
"%s: threaded backtrace_full noinline\n", this_fail > 0 ?
"FAIL" :
"PASS");
154#if BACKTRACE_SUPPORTED
155#if BACKTRACE_SUPPORTS_THREADS
160 exit (
failures ? EXIT_FAILURE : EXIT_SUCCESS);
#define BACKTRACE_SUPPORTS_THREADS
int backtrace_full(struct backtrace_state *state, int skip, backtrace_full_callback callback, backtrace_error_callback error_callback, void *data)
struct backtrace_state * backtrace_create_state(const char *filename, int threaded, backtrace_error_callback error_callback, void *data)
void check(const char *name, int index, const struct info *all, int want_lineno, const char *want_function, const char *want_file, int *failed)
void error_callback_create(void *data ATTRIBUTE_UNUSED, const char *msg, int errnum)
int callback_one(void *vdata, uintptr_t pc ATTRIBUTE_UNUSED, const char *filename, int lineno, const char *function)
void error_callback_one(void *vdata, const char *msg, int errnum)
static int f2(static int f3(int)
int main(int argc ATTRIBUTE_UNUSED, char **argv)
static int f3(int f1line, int f2line)
Functions to help with cleanup.