Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-28734

Python debugger does not work well when running in Terminal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 9.0.1, Qt Creator 11.0.0-beta1
    • Debugger
    • Linux/X11
    • 60a588215 (master)

    Description

      • In general, I don't see terminal output when debugging (while I see it when running with Ctrl+R)
      • It seems I cannot get over `input()` lines (probably my return key press is never received?!)

      Example:

      # This Python file uses the following encoding: utf-8
      
      fb = False
      num = int(input('Enter a number: '))
      
      if (num % 3) == 0:
      	print("Fizz", end='')
      	fb = True
      if (num % 5) == 0:
      	print("Buzz", end='')
      	fb = True
      
      if fb == False:
      	print(num, end='')
      print("")
      
      • Break after the input line
      • Enter some number in the terminal and press Enter
      • The program just stucks

      Left log:

      Running requested...
break /home/ah/FizzBuzz/main.py:7
Stopped.
qdebug('stackListFrames',{})
qdebug('updateData',{"expanded":["local","watch","inspect","return"],"fancy":1,"formats":{"local.answer.dataId":23,"local.msg.dataId":23,"local.msg.id.w":23,"local.value":22,"watch.1.table.eraseSegmentInProgress":23,"watch.3.id.w":23,"watch.4.dataId":23,"watch.4.id.w":23},"frame":-1,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[]})
Run requested...
Running.
continue
      

      Right log:

      w

dStart parameters: 'main.py' mode: 1
dABI: x86-linux-generic-elf-64bit
dLanguages: 
dExecutable: /usr/bin/python3 -u main.py [terminal]
dDirectory: /home/ah/FizzBuzz
dDebugger: /usr/bin/gdb
dProject: /home/ah/FizzBuzz
dAdditional Search Directories:
dSysroot: 
dDebug Source Location: 
dDebugger settings:
d/AdditionalArguments:   (default: )
d/AdjustBreakpointLocations: true  (default: true)
d/AlwaysAdjustColumnWidths: true  (default: true)
d/AutoDerefPointers: true  (default: true)
d/AutoEnrichParameters: true  (default: true)
d/BreakEvent:   (default: )
d/BreakOnAbort: false  (default: false)
d/BreakOnCatch: false  (default: false)
d/BreakOnCrtDbgReport: false  (default: false)
d/BreakOnFatal: false  (default: false)
d/BreakOnThrow: false  (default: false)
d/BreakOnWarning: false  (default: false)
d/BreakpointCorrection: true  (default: true)
d/BreakpointsFullPath: false  (default: false)
d/CDB_Console: false  (default: false)
d/CloseBuffersOnExit: false  (default: false)
d/CloseMemoryBuffersOnExit: true  (default: true)
d/DisplayStringLimit: 300  (default: 300)
d/EnableReverseDebugging: false  (default: false)
d/ExtraDumperFile:   (default: )
d/FirstChanceExceptionTaskEntry: true  (default: true)
d/FontSizeFollowsEditor: false  (default: false)
d/ForceLoggingToConsole: false  (default: false)
d/GdbCustomDumperCommands:   (default: )
d/GdbPostAttachCommands:   (default: )
d/GdbStartupCommands:   (default: )
d/IgnoreFirstChanceAccessViolation: false  (default: false)
d/IntelFlavor: false  (default: false)
d/LoadGdbDumpers2: false  (default: false)
d/LoadGdbInit: true  (default: true)
d/LogTimeStamps: false  (default: false)
d/MaximalStackDepth: 20  (default: 20)
d/MaximalStringLength: 10000  (default: 10000)
d/MultiInferior: false  (default: false)
d/RaiseOnInterrupt: true  (default: true)
d/SecondChanceExceptionTaskEntry: true  (default: true)
d/ShowQObjectNames2: true  (default: true)
d/ShowQmlObjectTree: true  (default: true)
d/ShowQtNamespace: true  (default: true)
d/ShowStandardNamespace: true  (default: true)
d/ShowThreadNames: false  (default: false)
d/SkipKnownFrames: false  (default: false)
d/SkipKnownFrames: false  (default: false)
d/SortStructMembers: true  (default: true)
d/SourcePaths:   (default: )
d/StationaryEditorWhileStepping: false  (default: false)
d/SwitchModeOnExit: false  (default: false)
d/SymbolPaths:   (default: )
d/TargetAsync: false  (default: false)
d/UseAlternatingRowColours: false  (default: false)
d/UseAnnotations: true  (default: true)
d/UseCodeModel: true  (default: true)
d/UseDebuggingHelper: true  (default: true)
d/UseDynamicType: true  (default: true)
d/UseIndexCache: true  (default: true)
d/UseMessageBoxForSignals: true  (default: true)
d/UsePseudoTracepoints: true  (default: true)
d/UsePythonDumper: true  (default: true)
d/UseToolTips: true  (default: true)
d/UseToolTipsInBreakpointsView: false  (default: false)
d/UseToolTipsInLocalsView: false  (default: false)
d/UseToolTipsInStackView: true  (default: true)
d/WarnOnReleaseBuilds: true  (default: true)
d/WatchdogTimeout: 20  (default: 20)
dState changed from DebuggerNotReady(0) to EngineSetupRequested(1)
dCALL: SETUP ENGINE
dSTARTING /usr/bin/python3 /opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py /home/ah/FizzBuzz/main.py /home/ah/FizzBuzz
dNOTE: ENGINE SETUP OK
dState changed from EngineSetupRequested(1) to EngineRunRequested(3)
dCALL: RUN ENGINE
 Running requested...
dTAKING OWNERSHIP OF BREAKPOINT 23
<break /home/ah/FizzBuzz/main.py:7
dNOTE: ENGINE RUN AND INFERIOR STOP OK
 Stopped.
dState changed from EngineRunRequested(3) to InferiorStopOk(10)
<qdebug('stackListFrames',{})
<qdebug('updateData',{"expanded":["local","watch","inspect","return"],"fancy":1,"formats":{"local.answer.dataId":23,"local.msg.dataId":23,"local.msg.id.w":23,"local.value":22,"watch.1.table.eraseSegmentInProgress":23,"watch.3.id.w":23,"watch.4.dataId":23,"watch.4.id.w":23},"frame":-1,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[]})
>DIR: ['self']
>ARGV: ['/home/ah/FizzBuzz/main.py', '/home/ah/FizzBuzz']
>MAIN: /home/ah/FizzBuzz/main.py
>@
>location={file="/home/ah/FizzBuzz/main.py",line="3"}@

>LINE: break /home/ah/FizzBuzz/main.py:7
>LINE 0: break /home/ah/FizzBuzz/main.py:7
>LINE 1: break /home/ah/FizzBuzz/main.py:7
>Breakpoint 1 at /home/ah/FizzBuzz/main.py:7
>LINE: qdebug('stackListFrames',{})
>LINE 0: qdebug('stackListFrames',{})
>LINE 1: qdebug('stackListFrames',{})
>@
>stack={current-thread="1",frames=[{file="/home/ah/FizzBuzz/main.py",line="3",level="1",}]}@
>LINE: qdebug('updateData',{"expanded":["local","watch","inspect","return"],"fancy":1,"formats":{"local.answer.dataId":23,"local.msg.dataId":23,"local.msg.id.w":23,"local.value":22,"watch.1.table.eraseSegmentInProgress":23,"watch.3.id.w":23,"watch.4.dataId":23,"watch.4.id.w":23},"frame":-1,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[]})
>LINE 0: qdebug('updateData',{"expanded":["local","watch","inspect","return"],"fancy":1,"formats":{"local.answer.dataId":23,"local.msg.dataId":23,"local.msg.id.w":23,"local.value":22,"watch.1.table.eraseSegmentInProgress":23,"watch.3.id.w":23,"watch.4.dataId":23,"watch.4.id.w":23},"frame":-1,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[]})
>LINE 1: qdebug('updateData',{"expanded":["local","watch","inspect","return"],"fancy":1,"formats":{"local.answer.dataId":23,"local.msg.dataId":23,"local.msg.id.w":23,"local.value":22,"watch.1.table.eraseSegmentInProgress":23,"watch.3.id.w":23,"watch.4.dataId":23,"watch.4.id.w":23},"frame":-1,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[]})
>@
>data={}{frame="0"}@

dNOTE: INFERIOR RUN REQUESTED
 Run requested...
dState changed from InferiorStopOk(10) to InferiorRunRequested(6)
dNOTE: INFERIOR RUN OK
 Running.
dState changed from InferiorRunRequested(6) to InferiorRunOk(7)
<continue
>LINE: continue
>LINE 0: continue
>LINE 1: continue

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-28734
        # Subject Branch Project Status CR V

        Activity

          People

            artem.sokolovskii Artem Sokolovskii
            aha_1980 André Hartmann
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes