Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to disable escaping of GDB Debugger Log in Qt Creator?

How to disable escaping of GDB Debugger Log in Qt Creator?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 2 Posters 882 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sergey Gromov
    wrote on last edited by
    #1

    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?

    aha_1980A 1 Reply Last reply
    0
    • S Sergey Gromov

      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?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Sergey-Gromov if you don't mind edit code, surely.

      Otherwise probably not.

      Qt has to stay free or it will die.

      S 1 Reply Last reply
      0
      • aha_1980A aha_1980

        @Sergey-Gromov if you don't mind edit code, surely.

        Otherwise probably not.

        S Offline
        S Offline
        Sergey Gromov
        wrote on last edited by
        #3

        @aha_1980, do you mean I'll have to build Creator from sources? That's not ideal but I may try that. Where do I look? My understanding is that I need to find the QDebug instance and call noquote() during initialization.

        aha_1980A 1 Reply Last reply
        0
        • S Sergey Gromov

          @aha_1980, do you mean I'll have to build Creator from sources? That's not ideal but I may try that. Where do I look? My understanding is that I need to find the QDebug instance and call noquote() during initialization.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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?

          Qt has to stay free or it will die.

          S 1 Reply Last reply
          1
          • aha_1980A aha_1980

            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?

            S Offline
            S Offline
            Sergey Gromov
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved