[英]GDB crashing - UNEXPECTED GDB STDERR: Fatal Python error: Py_Initialize: Unable to get the locale encoding
I am using QtCreator in ubuntu(virtual box) to run a simple c++ program(hello.cpp). 我在ubuntu(虚拟盒子)中使用QtCreator来运行一个简单的c ++程序(hello.cpp)。 The QtCreator is building and running the application fine .But when it is not letting me to debug. QtCreator正在构建和运行应用程序。但是当它不让我调试时。 I am running a shell script on ubuntu of vbox to get some cross compilers required, since i have a hard ware which holds arm architecture. 我正在vbox的ubuntu上运行一个shell脚本来获得一些需要的交叉编译器,因为我有一个可以保存arm架构的硬件。 finally i want to push the cross compiled executable on to the hardware and do remote debugging. 最后,我想将交叉编译的可执行文件推送到硬件上并进行远程调试。 Before that i am trying to perfrom desktop debugging on ubuntu, but the GDB is crashing. 在此之前,我试图在ubuntu上进行桌面调试,但GDB正在崩溃。 I think GDB is getting confused with some python path. 我认为GDB正在与一些python路径混淆。 Can anyone help me with this? 谁能帮我这个? Here is the picture of GDB log: 这是GDB日志的图片:
This error most likely means that Python isn't installed properly on your machine. 此错误很可能意味着您的计算机上未正确安装Python。 This error comes during gdb initialization, when it tries to initialize the Python interpreter. 在gdb初始化期间,当它尝试初始化Python解释器时,会出现此错误。 If Py_Initialize
fails, there isn't much gdb can do about it... 如果Py_Initialize
失败,那么gdb可以做些什么呢......
The issue is due to gdb optimization environment variables. 问题是由于gdb优化环境变量。 there are 4 variables in in the ide, configured with -o2 optimization. ide中有4个变量,配置-o2优化。 Remove the -o2 optimization in the front of variables, then it will resolve your issue. 删除变量前面的-o2优化,然后它将解决您的问题。 In my case its -o2, in your case, it can be other optimizations. 在我的情况下,它的-o2,在你的情况下,它可以是其他优化。 Please look for them. 请找他们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.