[Development] Proposal: Changing the default output of qDebug and friends

Olivier Goffart olivier at woboq.com
Thu Mar 29 08:12:22 CEST 2012


On Thursday 29 March 2012 10:02:59 Lincoln Ramsay wrote:
> On 03/29/2012 09:54 AM, ext Olivier Goffart wrote:
> > That would be possible with runtime backtrace (#include<execinfo.h>
> > backtrace(), on Linux)
> > So one could add some tokens in QT_MESSAGE_PATTERN to get the backtrace.
> > The problem is that runtime backtrace is often not really accurate.
> 
> Getting a whole backtrace is another problem entirely. I'd just like to
> see the caller's filename and line number used when a function is trying
> to warn you that someone has used it incorrectly.

Ant the only way to do it is to get a backtrace.

But you could specify, in the pattern, the number of stack frame you want. (I 
suppose two would already be enough in most cases.

> And yeah... optimized binaries make it difficult for this to work 100%
> while it's an add-on to the language :(





More information about the Development mailing list