您的位置:首页 > 编程语言 > Qt开发

Qt 5.10.1 win10 系统无法调试的解决办法

2018-03-27 00:21 746 查看
随便写了一个程序,直接运行可以,但是调试的时候,运行成功之后就没有反应了。
打开views--> debugger log一看:wNote: This log contains possibly confidential information about your machine, environment variables, in-memory data of the processes you are debugging, and more. It is never transferred over the internet by Qt Creator, and only stored to disk if you manually use the respective option from the context menu, or through mechanisms that are not under the control of Qt Creator, for instance in swap files.
wYou may be asked to share the contents of this log when reporting bugs related to debugger operation. In this case, make sure your submission does not contain data you do not want to or you are not allowed to share.
w

s为 ABI 'x86-windows-msys-pe-32bit'启动调试器'GdbEngine'...
dStart parameters: 'xxxxxxxxxx' mode: 1
dABI: x86-windows-msys-pe-32bit
dLanguages: c++
dExecutable: E:\test.exe
dDirectory:
dDebugger: G:\.....\gdb.exe
dProject: E:\.....
dAdditional Search Directories:
dSysroot:
dDebug Source Location:
dDebugger settings:
dAdditionalArguments: (default: )
dAdjustBreakpointLocations: true (default: true)
dAllPluginBreakpoints: true (default: true)
dAlwaysAdjustColumnWidths: true (default: true)
dAutoDerefPointers: true (default: true)
dAutoEnrichParameters: true (default: true)
dAutoQuit: false (default: false)
dBreakEvent: (default: )
dBreakOnAbort: false (default: false)
dBreakOnCatch: false (default: false)
dBreakOnCrtDbgReport: false (default: false)
dBreakOnFatal: false (default: false)
dBreakOnThrow: false (default: false)
dBreakOnWarning: false (default: false)
dBreakpointCorrection: true (default: true)
dBreakpointsFullPath: false (default: false)
dCDB_Console: false (default: false)
dCloseBuffersOnExit: false (default: false)
dCloseMemoryBuffersOnExit: true (default: true)
dDisplayStringLimit: 100 (default: 100)
dEnableReverseDebugging: false (default: false)
dExtraDumperFile: (default: )
dFontSizeFollowsEditor: false (default: false)
dGdbCustomDumperCommands: (default: )
dGdbPostAttachCommands: (default: )
dGdbStartupCommands: (default: )
dIdentifyDebugInfoPackages: false (default: false)
dIgnoreFirstChanceAccessViolation: false (default: false)
dIntelFlavor: false (default: false)
dLoadGdbDumpers2: false (default: false)
dLoadGdbInit: true (default: true)
dLogTimeStamps: false (default: false)
dMaximalStackDepth: 20 (default: 20)
dMaximalStringLength: 10000 (default: 10000)
dMultiInferior: false (default: false)
dNoPluginBreakpoints: false (default: false)
dQmlInspector.ShowAppOnTop: false (default: false)
dRaiseOnInterrupt: true (default: true)
dRegisterForPostMortem: false (default: false)
dSelectedPluginBreakpoints: false (default: false)
dSelectedPluginBreakpointsPattern: .* (default: .*)
dShowQObjectNames2: true (default: true)
dShowQmlObjectTree: true (default: true)
dShowQtNamespace: true (default: true)
dShowStandardNamespace: true (default: true)
dShowThreadNames: false (default: false)
dSkipKnownFrames: false (default: false)
dSortStructMembers: true (default: true)
dSourcePaths: (default: )
dStationaryEditorWhileStepping: false (default: false)
dSwitchModeOnExit: false (default: false)
dSymbolPaths: (default: )
dTargetAsync: false (default: false)
dUseAddressInBreakpointsView: false (default: false)
dUseAddressInStackView: false (default: false)
dUseAlternatingRowColours: false (default: false)
dUseCodeModel: true (default: true)
dUseDebuggingHelper: true (default: true)
dUseDynamicType: true (default: true)
dUseMessageBoxForSignals: true (default: true)
dUsePythonDumper: true (default: true)
dUseToolTips: true (default: true)
dUseToolTipsInBreakpointsView: false (default: false)
dUseToolTipsInBreakpointsView: false (default: true) ***
dUseToolTipsInLocalsView: false (default: false)
dWarnOnReleaseBuilds: true (default: true)
dWatchdogTimeout: 20 (default: 20)
dState changed from DebuggerNotReady(0) to EngineSetupRequested(1) [master]
dCALL: SETUP ENGINE
dTRYING TO START ADAPTER
dENABLING TEST CASE: 0
dSTARTING G:.....gdb.exe --tty=\\.\pipe\creator-15948-25698 -i mi
dGDB STARTED, INITIALIZING IT
<1show version
<2show debug-file-directory
<3set print object on
<4set breakpoint pending on
<5set print elements 10000
<6set unwindonsignal on
<7set width 0
<8set height 0
s正在设置 inferior...
<9set substitute-path C:/work/build/qt5_workdir/w/s
<10set substitute-path Q:/qt5_workdir/w/s
<11set substitute-path c:/Users/qt/work/install
<12set substitute-path c:/users/qt/work/qt
<13python sys.path.insert(1, '')
<14python sys.path.append('G:/.../QT/Tools/mingw530_32/bin/data-directory/python')
<15python from gdbbridge import *
<16python theDumper.loadDumpers({"token":16})
dUNEXPECTED GDB STDERR: Traceback (most recent call last):
d File "g:\...\qt\tools\mingw530_32\share\gdb/python/gdb/__init__.py", line 144, in auto_load_packages
d __import__(modname)
d File "g:\....\qt\tools\mingw530_32\share\gdb/python/gdb/command/frame_filters.py", line 21, in <module>
d import copy
d File "C:\Python27\lib/copy.py", line 52, in <module>
d import weakref
d File "C:\Python27\lib/weakref.py", line 14, in <module>
d from _weakref import (
dImportError: cannot import name _remove_dead_weakref
d
dTraceback (most recent call last):
d File "g:\...\qt\tools\mingw530_32\share\gdb/python/gdb/__init__.py", line 144, in auto_load_packages
d __import__(modname)
d File "g:\...\qt\tools\mingw530_32\share\gdb/python/gdb/command/pretty_printers.py", line 19, in <module>
d import copy
d File "C:\Python27\lib/copy.py", line 52, in <module>
d import weakref
d File "C:\Python27\lib/weakref.py", line 14, in <module>
d from _weakref import (
dImportError: cannot import name _remove_dead_weakref
d
dTraceback (most recent call last):
d File "g:\...\qt\tools\mingw530_32\share\gdb/python/gdb/__init__.py", line 144, in auto_load_packages
d __import__(modname)
d File "g:\...\qt\tools\mingw530_32\share\gdb/python/gdb/command/type_printers.py", line 17, in <module>
d import copy
d File "C:\Python27\lib/copy.py", line 52, in <module>
d import weakref
d File "C:\Python27\lib/weakref.py", line 14, in <module>
d from _weakref import (
dImportError: cannot import name _remove_dead_weakref
d
>=thread-group-added,id="i1"
>~"GNU gdb (GDB) 7.10.1\n"
>~"Copyright (C) 2015 Free Software Foundation, Inc.\n"
>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
>~"This GDB was configured as \"i686-w64-mingw32\".\nType \"show configuration\" for configuration details."
>~"\nFor bug reporting instructions, please see:\n"
>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
>~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
>~"For help, type \"help\".\n"
>~"Type \"apropos word\" to search for commands related to \"word\".\n"

>&"show version\n"
>~"GNU gdb (GDB) 7.10.1\n"
>~"Copyright (C) 2015 Free Software Foundation, Inc.\n"
>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
>~"This GDB was configured as \"i686-w64-mingw32\".\nType \"show configuration\" for configuration details."
>~"\nFor bug reporting instructions, please see:\n"
>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
>~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
>~"For help, type \"
4000
help\".\n"
>~"Type \"apropos word\" to search for commands related to \"word\".\n"
>1^done
dPARSING VERSION: 1^done
dSUPPORTED GDB VERSION GNU gdb (GDB) 7.10.1
dCopyright (C) 2015 Free Software Foundation, Inc.
dLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
dThis is free software: you are free to change and redistribute it.
dThere is NO WARRANTY, to the extent permitted by law. Type "show copying"
dand "show warranty" for details.
dThis GDB was configured as "i686-w64-mingw32".
dType "show configuration" for configuration details.
dFor bug reporting instructions, please see:
d<http://www.gnu.org/software/gdb/bugs/>.
dFind the GDB manual and other documentation resources online at:
d<http://www.gnu.org/software/gdb/documentation/>.
dFor help, type "help".
dType "apropos word" to search for commands related to "word".
dGNU gdb (GDB) 7.10.1
dCopyright (C) 2015 Free Software Foundation, Inc.
dLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
dThis is free software: you are free to change and redistribute it.
dThere is NO WARRANTY, to the extent permitted by law. Type "show copying"
dand "show warranty" for details.
dThis GDB was configured as "i686-w64-mingw32".
dType "show configuration" for configuration details.
dFor bug reporting instructions, please see:
d<http://www.gnu.org/software/gdb/bugs/>.
dFind the GDB manual and other documentation resources online at:
d<http://www.gnu.org/software/gdb/documentation/>.
dFor help, type "help".
dType "apropos word" to search for commands related to "word".
dUSING GDB VERSION: 71001, BUILD: 2015
<17-interpreter-exec console "set target-async off"

>&"show debug-file-directory\n"
>~"The directory where separate debug symbols are searched for is \"c:\\c\\mingw530\\i686-530-posix-dwarf-rt_v4-rev0\\mingw32\\lib\\debug\".\n"
>2^done

>&"set print object on\n"
>=cmd-param-changed,param="print object",value="on"
>3^done

>&"set breakpoint pending on\n"
>=cmd-param-changed,param="breakpoint pending",value="on"
>4^done

>&"set print elements 10000\n"
>=cmd-param-changed,param="print elements",value="10000"
>5^done

>&"set unwindonsignal on\n"
>=cmd-param-changed,param="unwindonsignal",value="on"
>6^done

>&"set width 0\n"
>=cmd-param-changed,param="width",value="4294967295"
>7^done

>&"set height 0\n"
>8^done

>&"set substitute-path C:/work/build/qt5_workdir/w/s \n"
>9^done

>&"set substitute-path Q:/qt5_workdir/w/s \n"
>10^done

>&"set substitute-path c:/Users/qt/work/install \n"
>11^done

>&"set substitute-path c:/users/qt/work/qt \n"
>12^done

>&"python sys.path.insert(1, '')\n"
>13^done

>&"python sys.path.append('')\n"
>14^done

>&"python from gdbbridge import *\n"

>&"Traceback (most recent call last):\n"
>&" File \"<string>\", line 1, in <module>\n"
>&" File \"G:/.../QT/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py\", line 39, in <module>\n"
>&" from dumper import *\n"
>&" File \"G:/.../QT/Tools/QtCreator/share/qtcreator/debugger/dumper.py\", line 28, in <module>\n"
>&" import copy\n"
>&" File \"C:\\Python27\\lib/copy.py\", line 52, in <module>\n"
>&" import weakref\n"
>&" File \"C:\\Python27\\lib/weakref.py\", line 14, in <module>\n"
>&" from _weakref import (\n"
>&"ImportError: cannot import name _remove_dead_weakref\n"
>&"Error while executing Python code.\n"
>15^error,msg="Error while executing Python code."

>&"python theDumper.loadDumpers({\"token\":16})\n"
>&"Traceback (most recent call last):\n"
>&" File \"<string>\", line 1, in <module>\n"
>&"NameError: name 'theDumper' is not defined\n"
>&"Error while executing Python code.\n"
>16^error,msg="Error while executing Python code."
dNOTE: ENGINE SETUP FAILED
dState changed from EngineSetupRequested(1) to EngineSetupFailed(2) [master]
<Debugging has failed
dState changed from EngineSetupFailed(2) to DebuggerFinished(22) [master]

dQUIT DEBUGGER REQUESTED IN STATE 22
>17^done
dCOOKIE FOR TOKEN 17 ALREADY EATEN (DebuggerFinished). TWO RESPONSES FOR ONE COMMAND?

如上所示,一直显示python脚本运行错误,导致无法调试。
试了重装python 和重装qt 都没有效果。
最后发现把环境变量里的与python 相关的环境变量禁用掉,然后重开Qt creater就OK了。

最终测试发现:把环境变量PYTHONHOME和PYTHONPATH改掉就好了。

但是这样会影响python 使用。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  qt 无法调试
相关文章推荐