|
From: | Daniel J Sebald |
Subject: | Re: Debugging output |
Date: | Sat, 30 Jan 2016 17:43:11 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 01/30/2016 04:53 PM, LachlanA wrote:
Greetings all, I find it hard to debug crashes of GUI behaviour because stderr is redirected to the GUI, which disappears on the crash. Does anyone else have the same problem? If so, how do you overcome it?
From what I remember, the stderr/stdout/signal handling is a delicate thing in the GUI/core setup. There were several bug/patch reports along the way, but I don't think an acceptable solution ever emerged.
If there is no simple work-around, I'd suggest that stderr still go to the console, even if it is also sent to the GUI. Would that behaviour be acceptable?
Try it, but it might have side effects like cntrl-C not working correct or whatnot. My guess is you won't find a quick fix, although an in-depth fix might be possible. But there are multiple platforms to consider, so...
Also, I find that I often want a stack trace after a crash. Since crashes should be rare, and stack traces are small, I think there is a case for always trying to output a stack trace from the signal handler. I know that the recommended approach is to use gdb, which seems fine for the CLI, but running "bt" in gdb doesn't give the stack trace of the GUI thread. This behaviour could be disabled for the releases if you think the general public wouldn't like it, but I think it would be useful to have in the development branch. Thoughts?
Search around the Qt documentation for "qt debugging techniques", or "qDebug", and such. Maybe that will help.
Dan
[Prev in Thread] | Current Thread | [Next in Thread] |