Changeset View
Changeset View
Standalone View
Standalone View
core/core_debug.cpp
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "core_debug.h" | 21 | #include "core_debug.h" | ||
22 | 22 | | |||
23 | Q_LOGGING_CATEGORY(KDECONNECT_CORE, "kdeconnect.core") | 23 | Q_LOGGING_CATEGORY(KDECONNECT_CORE, "kdeconnect.core") | ||
24 | 24 | | |||
25 | #ifdef Q_OS_LINUX | 25 | #if defined(__GNU_LIBRARY__) | ||
26 | #include <execinfo.h> | 26 | #include <execinfo.h> | ||
27 | #include <stdlib.h> | 27 | #include <stdlib.h> | ||
28 | #include <unistd.h> | 28 | #include <unistd.h> | ||
29 | #endif | 29 | #endif | ||
30 | 30 | | |||
31 | void logBacktrace() | 31 | void logBacktrace() | ||
32 | { | 32 | { | ||
33 | #ifdef Q_OS_LINUX | 33 | #if defined(__GNU_LIBRARY__) | ||
34 | void* array[32]; | 34 | void* array[32]; | ||
35 | size_t size = backtrace (array, 32); | 35 | size_t size = backtrace (array, 32); | ||
36 | char** strings = backtrace_symbols (array, size); | 36 | char** strings = backtrace_symbols (array, size); | ||
37 | backtrace_symbols_fd(array, size, STDERR_FILENO); | 37 | backtrace_symbols_fd(array, size, STDERR_FILENO); | ||
38 | free (strings); | 38 | free (strings); | ||
39 | #endif | 39 | #endif | ||
40 | } | 40 | } |