Small improvements to g_on_error_stack_trace

Make the gdb commands match what /usr/bin/gstack uses,
and produce a stacktrace including all threads.
This commit is contained in:
Matthias Clasen 2024-10-29 00:29:36 -04:00 committed by Philip Withnall
parent 95cdd0f06f
commit f6e71c25ed

View File

@ -453,8 +453,10 @@ stack_trace (const char * const *args)
checked_write (in_fd[1], "quit\n", 5); checked_write (in_fd[1], "quit\n", 5);
#else #else
/* Don't wrap so that lines are not truncated */ /* Don't wrap so that lines are not truncated */
checked_write (in_fd[1], "set width unlimited\n", 20); checked_write (in_fd[1], "set width 0\n", 12);
checked_write (in_fd[1], "backtrace\n", 10); checked_write (in_fd[1], "set height 0\n", 13);
checked_write (in_fd[1], "set pagination no\n", 18);
checked_write (in_fd[1], "thread apply all backtrace\n", 27);
checked_write (in_fd[1], "p x = 0\n", 8); checked_write (in_fd[1], "p x = 0\n", 8);
checked_write (in_fd[1], "quit\n", 5); checked_write (in_fd[1], "quit\n", 5);
#endif #endif