Ubuntu 16.04에서 Python 3.5에서 Python 스택 추적을 얻을 수있었습니다.
설치 python3-dbg
및 python3-dev
:
$ sudo apt install python3-dbg python3-dev
python3-dbg
패키지에는 /usr/share/doc/python3-dbg/README.debug
다음 단계에서 사용할 패키지 사용법에 대한 간단한 문서가 함께 제공됩니다 .
압축이 풀린 GDB 도우미 스크립트 /usr/share/doc/python3.5/gdbinit.gz
를 ~/.gdbinit
다음에 추가 :
zcat /usr/share/doc/python3.5/gdbinit.gz >> ~/.gdbinit
이제 gdb는 Python 바이너리의 기호를 찾을 수 py-bt
있으며 gdb에서 Python 스택 추적을 표시하기 위해 작동합니다.
$ gdb -p 4762
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 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".
Attaching to process 4762
[New LWP 4852]
[New LWP 4853]
[New LWP 4854]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f38e43deb5d in poll () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) py-bt
Traceback (most recent call first):
File "/usr/bin/indicator-cpufreq", line 80, in <module>
Gtk.main()
(gdb)