gdb调试python代码,但没有名为test.py的源文件

时间:2017-10-11 08:59:39

标签: python debugging gdb

我开始学习使用gdb调试python代码。但是当我添加断点时,gdb会给出错误:“没有名为test.py的源文件。”

这是我的源代码test.py:

a = "foo"
b = "bar"

c = a + b
print c

这是我的gdb调试信息:

panzhengyu@ubuntu:~$ gdb python
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...Reading symbols from /usr/lib/debug//usr/bin/python2.7...done.
done.
(gdb) b pan.py:2
No source file named pan.py.
Make breakpoint pending on future shared library load? (y or [n]) 

0 个答案:

没有答案
相关问题