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

Python debugger cannot step over global string variables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 10.0.0
    • Qt Creator 9.0.1
    • Debugger
    • None
    • Linux/X11
    • f6afedeea (10.0)

    Description

      It seems only global string variables are affected.

      But once you have these in your program, you cannot step over these.

      # This Python file uses the following encoding: utf-8
      import sys
      
      num = 15
      
      str = ""
      if (num % 3) == 0:
      	str = "Fizz"
      if (num % 5) == 0:
      	str += "Buzz"
      if str == "":
      	str = num
      print(str)
      
      sys.exit(0)
      

      Break on the line `str = ""`, press F10 and the debugger exits.

      Left log:

      Running requested...
break /home/ah/FizzBuzz/main.py:6
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":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
Run requested...
Running.
continue
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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
Run requested...
Running.
next
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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
Debugger finished.
      

      Right log:

      wSome breakpoints cannot be handled by the debugger languages currently active, and will be ignored.<p>Affected are breakpoints 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

dStart parameters: 'main.py' mode: 1
dABI: x86-linux-generic-elf-64bit
dLanguages: 
dExecutable: /usr/bin/python3 -u main.py
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...
dBREAKPOINT 1 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 2 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 3 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 4 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 5 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 6 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 7 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 8 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 9 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 10 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 11 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 12 IS NOT ACCEPTED BY ENGINE 
dBREAKPOINT 13 IS NOT ACCEPTED BY ENGINE 
dTAKING OWNERSHIP OF BREAKPOINT 19
<break /home/ah/FizzBuzz/main.py:6
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":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})

>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="2"}@
>LINE: break /home/ah/FizzBuzz/main.py:6
>LINE 0: break /home/ah/FizzBuzz/main.py:6
>LINE 1: break /home/ah/FizzBuzz/main.py:6
>Breakpoint 1 at /home/ah/FizzBuzz/main.py:6
>LINE: qdebug('stackListFrames',{})
>LINE 0: qdebug('stackListFrames',{})
>LINE 1: qdebug('stackListFrames',{})
>@
>stack={current-thread="1",frames=[{file="/home/ah/FizzBuzz/main.py",line="2",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":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>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":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>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":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>@
>data={{iname="watch.0",wname="6D5F736369305F757362",value="<unavailable>",}}{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
>@
>location={file="/home/ah/FizzBuzz/main.py",line="6"}@
dSTOPPED AT: /home/ah/FizzBuzz/main.py:6
dNOTE: INFERIOR SPONTANEOUS STOP
 Stopped.
dState changed from InferiorRunOk(7) 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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>LINE: qdebug('stackListFrames',{})
>LINE 0: qdebug('stackListFrames',{})
>LINE 1: qdebug('stackListFrames',{})
>@
>stack={current-thread="1",frames=[{file="/home/ah/FizzBuzz/main.py",line="6",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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
>@
>data={{iname="local.num",name="num",type="int",value="15",},{iname="watch.0",wname="6D5F736369305F757362",value="<unavailable>",}}{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)
<next
>LINE: next
>LINE 0: next
>LINE 1: next
>@
>location={file="/home/ah/FizzBuzz/main.py",line="7"}@
dSTOPPED AT: /home/ah/FizzBuzz/main.py:7
dNOTE: INFERIOR SPONTANEOUS STOP
 Stopped.
dState changed from InferiorRunOk(7) 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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})

>LINE: qdebug('stackListFrames',{})
>Uncaught exception. Entering post mortem debugging
>@
>location={file="/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py",line="688"}@
dUnexpected pdb stderr: Traceback (most recent call last):
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 742, in runit
d    self.run(statement)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 591, in run
d    exec(cmd, pyGlobals, pyLocals)
d  File "<string>", line 1, in <module>
d  File "/home/ah/FizzBuzz/main.py", line 7, in <module>
d    if (num % 3) == 0:
d  File "/home/ah/FizzBuzz/main.py", line 7, in <module>
d    if (num % 3) == 0:
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 275, in trace_dispatch
d    return self.dispatch_line(frame)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 293, in dispatch_line
d    self.user_line(frame)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 806, in user_line
d    self.interaction(frame, None)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 870, in interaction
d    self.cmdloop()
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 656, in cmdloop
d    stop = self.onecmd(line)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 688, in onecmd
d    line = str(line)
dTypeError: 'str' object is not callable
>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":0,"nativeMixed":0,"passexceptions":0,"typeformats":{"KAdcValue":22,"double":26},"watchers":[{"exp":"6d5f736369305f757362","iname":"watch.0"}]})
dUnexpected pdb stderr: Traceback (most recent call last):
dUnexpected pdb stderr:   File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 742, in runit
d    self.run(statement)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 591, in run
d    exec(cmd, pyGlobals, pyLocals)
d  File "<string>", line 1, in <module>
d  File "/home/ah/FizzBuzz/main.py", line 7, in <module>
d    if (num % 3) == 0:
d  File "/home/ah/FizzBuzz/main.py", line 7, in <module>
d    if (num % 3) == 0:
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 275, in trace_dispatch
d    return self.dispatch_line(frame)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 293, in dispatch_line
d    self.user_line(frame)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 806, in user_line
d    self.interaction(frame, None)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 870, in interaction
d    self.cmdloop()
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 656, in cmdloop
dUnexpected pdb stderr:     stop = self.onecmd(line)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 688, in onecmd
d    line = str(line)
dTypeError: 'str' object is not callable
d
dDuring handling of the above exception, another exception occurred:
d
dTraceback (most recent call last):
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 1727, in <module>
d    __the_dumper__.runit()
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 762, in runit
d    self.interaction(None, t)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 870, in interaction
dUnexpected pdb stderr:     self.cmdloop()
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 656, in cmdloop
dUnexpected pdb stderr:     stop = self.onecmd(line)
d  File "/opt/Qt/Tools/QtCreator/share/qtcreator/debugger/pdbbridge.py", line 688, in onecmd
dUnexpected pdb stderr:     line = str(line)
dTypeError: 'str' object is not callable

dPDB PROCESS FINISHED, status 0, code 1
dNOTE: ENGINE SPONTANEOUS SHUTDOWN
dState changed BY FORCE from InferiorStopOk(10) to EngineShutdownFinished(15)
 Debugger finished.
dState changed from EngineShutdownFinished(15) to DebuggerFinished(16)

      

      Attachments

        Activity

          People

            hjk hjk
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: