gcj still doesn't work because, for some reason I don't yet understand, backtraces are broken. When backtrace is called from a thread, it wanders off the end of the stack and segfaults. This doesn't happen with F13. When I find out what's broken it, I'll let you know. To compile the example, use gcc thread.c -lpthread -fexceptions Andrew.
#include <pthread.h> #include <stdio.h> typedef enum { _URC_OK = 0, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_END_OF_STACK = 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 7, _URC_CONTINUE_UNWIND = 8, _URC_FAILURE = 9 } _Unwind_Reason_Code; typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (void *, void *); _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void*); _Unwind_Reason_Code callback(void *p, void *p1) { int *state = p1; printf ("%d\n", *state); (*state)++; return _URC_OK; } void *poo() { printf("Hello from the thread\n"); int state = 0; _Unwind_Backtrace (callback, &state); return NULL; } void *bar() { printf("Hello from the main thread\n"); int state = 0; _Unwind_Backtrace (callback, &state); return NULL; } void main () { pthread_t the_thread; pthread_attr_t attrs; bar(); pthread_attr_init(&attrs); int retval = pthread_create(&the_thread, &attrs, poo, NULL); pthread_join(the_thread, NULL); }
_______________________________________________ arm mailing list arm@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/arm