How to disable escaping of GDB Debugger Log in Qt Creator?
-
Whenever I use Debugger Log feature in Qt Creator the debugger output gets escaped/quoted making it very hard to read. Currently I'm using Qt Creator 4.8.1 but it was like this in all versions of Qt Creator I ever used. E.g. here's the output of a simple command
p *m_entry
:368p *m_entry >&"p *m_entry\n" >&"Could not find operator*.\n" >368^error,msg="Could not find operator*."
I don't want all this noise. I want to see what I would see if I entered this command in GDB directly:
p *m_entry Could not find operator*.
Is this possible?
-
@Sergey-Gromov if you don't mind edit code, surely.
Otherwise probably not.
-
Hi @Sergey-Gromov,
yes you will have to build Creator from source and modify some code.
I don't know the exact location, but I think this is a good start point:
https://code.woboq.org/qt5/qt-creator/src/plugins/debugger/logwindow.cpp.html
And honestly, I don't know why the output is quoted and if the developers would accept a setting for that.
May I ask why you need this output unquoted?
-
@aha_1980 Sometimes I find myself in a situation where locals/watch window does not work. E.g. it may report that a value is optimized out while printing via Debugger Log works. Other times opening a sub-group in Locals triggers a segfault while the Debugger Log allows me to inspect the state. Another application is printing a long string: Locals window trims strings after a certain length, so e.g. if I want to verify whether a long URL actually points to a valid resource I have no other way of seeing the whole value but print it via direct debugger interaction.
That's why I use Debugger Log. Regarding unquoted output it's just I never needed the quoting. GDB output is unambiguous enough, it does not require any additional level of encoding. The extra output distracts from understanding the information provided by the debugger.