jeudi 27 juillet 2023

How to print the backtrace of all threads?

I am using

void *array[10];
size_t size = backtrace(array, 10);
backtrace_symbols_fd(array, size, STDERR_FILENO);

to print the backtrace for debugging a crash in the field that is difficult to reproduce in the lab. It looks like the crash is not being caused by the thread in the backtrace. Is there a way to print the backtrace of all threads without using core dump and gdb?

Aucun commentaire:

Enregistrer un commentaire