gdb 版本 >7 的 对python调试有特别支持,参考:

https://docs.python.org/devguide/gdb.html?highlight=gdb

https://blog.csdn.net/BaishanCloud/article/details/76422782

可用命令有:

py-bt
py-list
...

示例:

centos7, default python2.7, 自自安装 python3.5,需要在gdb中加载3.5的 libpython.py,本机路径为 /home/cl/python/Python-3.5.3/Tools/gdb

https://stackoverflow.com/questions/14885328/what-is-needed-to-use-gdb-7s-support-for-debugging-python-programs

(gdb) python
>import sys
>sys.path.insert(0, "/home/cl/python/Python-3.5.3/Tools/gdb")
>import libpython
>
end
(gdb) py-bt
...

Notes:

gdb中运行发生死锁、阻塞等情况,导致无法暂停的,可以在外部运行,然后 gdb attach pid

gdb 调试 python的更多相关文章

  1. 使用gdb调试Python进程

    使用gdb调试Python进程 有时我们会想调试一个正在运行的Python进程,或者一个Python进程的coredump.例如现在遇到一个mod_wsgi的进程僵死了,不接受请求,想看看究竟是运行到 ...

  2. 用gdb调试python多线程代码-记一次死锁的发现

    | 版权:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接.如有问题,可以邮件:wangxu198709@gmail.com 前言 相信很多人都有 ...

  3. gdb调试python

    一.概述 有时我们会想调试一个正在运行的Python进程,或者一个Python进程的coredump.例如现在遇到一个mod_wsgi的进程僵死了,不接受请求,想看看究竟是运行到哪行Python代码呢 ...

  4. [gdb][python][libpython] 使用gdb调试python脚本

    https://devguide.python.org/gdb/ https://sourceware.org/gdb/current/onlinedocs/gdb/Python.html#Pytho ...

  5. 使用gdb调试python程序

    参考文章:https://mozillazg.com/2017/07/debug-running-python-process-with-gdb.html https://blog.alswl.com ...

  6. GDB 调试PYTHON

    http://www.cnblogs.com/dkblog/p/3806277.html

  7. 用GDB排查Python程序故障

        某Team在用Python开发一些代码,涉及子进程以及设法消除僵尸进程的需求.实践中他们碰上Python程序非预期退出的现象.最初他们决定用GDB调试Python解释器,查看exit()的源头 ...

  8. gdb可以调试python的pdb么

    1.如题: gdb可以调试python的pdb么? 答案:可以,实验如下. 2.实验: 生成一个a.py代码文件,代码如下: import pdb a = 1 print "111" ...

  9. Android gdb 调试

    [1].终端目录设置到: proj.android[2].make文件的编译选项加上: -g -gstabs+[3].执行编译脚本: sh ./build_native.sh NDK_DEBUG=1[ ...

随机推荐

  1. @Autowired注解与@Qualifier注解搭配使用

    问题:当一个接口实现由两个实现类时,只使用@Autowired注解,会报错,如下图所示 实现类1 实现类2 controller中注入 然后启动服务报错,如下所示: Exception encount ...

  2. 关于js数组的简单复制

    var a=[]; a.push(1); a.push(2); a.push(3); var b=a; b[0]=4; alert(a);//4,2,3 alert(b);//4,2,3 这种写法由于 ...

  3. SoapUI--the use of Script Library

    SoapUI--the use of Script Library 有两种方法在soapUI中引用自己的groovy脚本库. 方法一:把自己的script folder放到soapUI install ...

  4. thinkPHP验证码不显示问题

    使用验证码的时候,不显示图片时,要清理下输出缓存:ob_clean_end();

  5. JSP学习(2)---四种基本语法与三种编译指令

    JSP的异常可以不处理,即使是checked异常. 四种基本语法: jsp声明,jsp注释,jsp表达式,jsp脚本 三种编译指令: page,include,taglib 下面是具体的练习. sho ...

  6. transfer model derived to fk model format

    It should be noted that when using fk, the definition of model format is as belows: 1: 2: when using ...

  7. change the version of python on my centos

    There are two versions of aconda: aconda and aconda3 in my home directorys. When comment the environ ...

  8. web APIS

    WEB API系列:   很多人都很迷惑,既然有了WCF为什么还要有WEB API?WEB API会不会取代WCF? 就我的看法,WCF提供的是一种RPC实现的集合,WCF的设计更多地考虑了SOA的场 ...

  9. 20175224 2018-2019-2 《Java程序设计》第七周学习总结

    教材学习内容总结 第八章 常用实用类 String类 构造String对象:常量对象:String对象:引用String常量. 字符串的并置:String对象使用“+”进行并置运算,即首尾相接. 字符 ...

  10. 日积月累--线程中断interrupt()方法

    线程中断方法interrupt()方法的理解: interrupt()方法的源码: interrupted()方法的源码及注解: isInterrupted()方法源码及注解: 在了解这个方法之前我们 ...